Ajax stand for asynchronous JavaScript and XML and it is a group of interrelated web development techniques used on the client-side to create interactive web applications. With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behaviour of the existing page.
Jesse James Garrett explained that the following technologies are required:
- HTML or XHTML and CSS for presentation
- the Document Object Model for dynamic display of and interaction with data
- XML and XSLT for the interchange, and manipulation and display, of data, respectively
- the XMLHttpRequest object for asynchronous communication
- JavaScript to bring these technologies together
JavaScript is not the only client-side scripting language that can be used for implementing an Ajax application. Other languages such as VBScript are also capable of the required functionality. However JavaScript is the most popular language for Ajax programming due to its inclusion in and compatibility with the majority of modern web browsers.
XML is not required for data interchange and therefore XSLT is not required for the manipulation of data. JavaScript Object Notation (JSON) is often used as an alternative format for data interchange, although other formats such as preformatted HTML or plain text can also be used.
Rails has a simple, consistent model for how it implements Ajax operations. Once the browser has rendered and displayed the initial web page, different user actions cause it to display a new web page or trigger an Ajax operation:- A trigger action occurs. This could be the user clicking on a button or link, the user making changes to the data on a form or in a field, or just a periodic trigger (based on a timer).
- Data associated with the trigger (a field or an entire form) is sent asynchronously to an action handler on the server via XMLHttpRequest.
- The server-side action handler takes some action (that’s why it is an action handler) based on the data, and returns an HTML fragment as its response.
- The client-side JavaScript (created automatically by Rails) receives the HTML fragment and uses it to update a specified part of the current page’s HTML, often the content of a
tag.
Reference:-
Wikipedia 2010, Ajax (programming), last modified 23 Apr 2010, viewed 29 Apr 2010, http://en.wikipedia.org/wiki/Ajax_(programming)
No comments:
Post a Comment