13.07.2015 Views

Thesis full text PDF - Politecnico di Milano

Thesis full text PDF - Politecnico di Milano

Thesis full text PDF - Politecnico di Milano

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

AJAX application development possible. The HTTP requests made with XMLHttpRequest work justas if the browser were making normal requests to load a page or submit a form, but without theuser ever having to leave the currently loaded web page. Microsoft first implementedXMLHttpRequest in Internet Explorer 5 for Windows as an ActiveX object. The Mozilla projectprovided a JavaScript-native version with a compatible API in the Mozilla browser, starting inversion 1.0. (It’s also available in Firefox, of course.) Apple has added XMLHttpRequest to Safarisince version 1.2. The response from the server, either an XML document or a string of <strong>text</strong>, canbe passed to JavaScript to use however the developer sees fit, often to update some piece of theweb application’s user interface.Figure 2.2 – Standard Ajax interactionPutting it All Together: JavaScriptJavaScript is the glue that holds your AJAX application together. It performs multiple roles inAJAX development:controlling HTTP requests that are made using XMLHttpRequestparsing the result that comes back from the server, using either DOM manipulationmethods, XSLT, or custom methods, depen<strong>di</strong>ng on the data exchange format usedpresenting the resulting data in the user interface, either by using DOM manipulationmethods to insert content into the web page, by updating an element’s innerHTMLproperty, or by changing elements’ CSS propertiesBecause of its long history of use in lightweight web programming (and at the hands ofinexperienced programmers), JavaScript has not been seen by many tra<strong>di</strong>tional application13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!