Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
AJaX

AJaX

Ratings: (0)|Views: 7 |Likes:
Published by bonamrajesh
Ajax Introduction and Example,

Ajax for Beginers
Ajax Introduction and Example,

Ajax for Beginers

More info:

Published by: bonamrajesh on Jun 02, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

06/14/2009

pdf

text

original

 
1
AJaX1
Asynchronous JavaScript and XML(AJaX)
Object Computing, Inc.Mark Volkmannmark@ociweb.com
AJaX2
Topics Covered
What is AJaX?JavaScript OverviewXMLHttpRequest(XHR)SarissaJavaScript LibraryREST OverviewDemo DescriptionDemo Sequence DiagramsDemo REST ServerDemo XHTMLDemo JavaScriptWrapup
 
2
AJaX3
What is AJaX?
A name given to an existing approachto building dynamic web applicationsWeb pages use JavaScript to make asynchronous callsto web-based services that typically return XML
allows user to continue interacting with web pagewhile waiting for data to be returnedpage can be updated without refreshing browserresults in a better user experiencethere are AJaXlibraries that reduce the amountof JavaScript code that must be written
Uses a JavaScript class called XMLHttpRequest
AJaX4
A Good Acronym?
A is for “asynchronous”
requests can be made asynchronously or synchronouslyboth techniques allow web page to be updated without refreshing itanything useful the user can do while processing request?
if yes then use asynchronous, otherwise use synchronous
J is for “JavaScript”
typically JavaScript is used on the client-side (in the browser)
only programming language supported out-of-the-box by most web browsers
can use any language on server-side that canaccept HTTP requests and return HTTP responses
Java servlets, Ruby servlets, CGI scripts, …
X is for XML
request and response messages can contain XML
can easily invoke REST-style services
can really contain any text (single text value, delimited text, …)
 
3
AJaX5
Uses For AJaX
Asynchronous
examples
Google Maps
http://maps.google.com
asynchronously loads graphic tiles to support map scrolling
Google Suggest –
http://www.google.com/suggest
asynchronously updates list of possible topic matchesbased on what has been typed so far
Synchronous
even when there is nothing useful for the user to doafter a request is submitted to a server,AJaXcan be used to retrieve data andupdate selected parts of the pagewithout refreshing the entire page
better user experience
AJaX6
JavaScript Overview
A programming language with syntax similar to JavaSupported by web browsers
JavaScript can be downloaded from web servers along with HTMLand executed in the browser
Syntax to use from HTML
add
<script>
tag(s) to head section of HTMLcan embed JavaScript code inside HTMLor refer to external JavaScript filesembedding
<script type="text/javascript"> ...
code
... </script>
referring
<script type="text/javascript" src="
url
"></script>
these notes use XHTMLinstead of HTML
The XHTML DTD declaration for the
script
tag says
<!ELEMENT script (#PCDATA)>
,and the XHTML specs says “Given an empty instance of an elementwhose content model is not EMPTY (for example, an empty title orparagraph)do not use the minimized form (e.g.
use
<p> </p>
and not
<p />
).

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->