11 - AJAX

11 - AJAX - CSE 135 Client-Side Programming Ajax...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CSE 135 Client-Side Programming Ajax Interactive Applications Using Ajax Ajax is a set of technologies that collectively enable interactive applications – Hallmark: Part of a page changing asynchronously Ajax = Asynchronous JavaScript and XML Extensive use in Gmail, Yahoo! Finance, etc. Only one really new primitive: JavaScript uses a (client side) 2 JavaScript uses a (client side) XMLHttpRequest to asynchronously communicate with the server http://www.w3.org/TR/XMLHttpRequest/
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 So Far in Class… Client Communicates Synchronously with Server Starting Web Page Submit New Web Page Server-side Code Even if the new page is almost identical to starting web page 3 identical to starting web page, the server engages in total re- computation, creation and transmission of new response POOR INTERACTION Ajax Client Communicates Asynchronously with Server Web Page Server-side Code Asynchronous XHR HTTP Request JavaScript- In response to some event, a JavaScript function creates XMLHttpRequest object and makes request to server. Browser does not redraw or reload. The request has also 4 JavaScript Recomputed Part HTTP Response The request has also defined which JavaScript function will be activated upon receiving the response. This function typically re-computes part of the page.
Background image of page 2
3 New JavaScript Material You can assign functions to variables and object properties – We will assign the function that handles the HTTP response to a property of XMLHttpRequest object 5 <body> Write your story here: <form action="nowhere" method="GET"> Ajax Example 1 <p/> <textarea rows="10" cols="80" name="story" onkeyup="lastTimeFunction();” > </textarea> <p/> <span id="lastTime"> 6 You have not typed anything in the above box yet </span> </form> </body>
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/31/2011 for the course CSE 135 taught by Professor Papakonstantinou during the Fall '10 term at UCSD.

Page1 / 10

11 - AJAX - CSE 135 Client-Side Programming Ajax...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online