08-01-2013, 01:17 PM
AJAX - Asynchronous JavaScript And XML
1AJAX.doc (Size: 289 KB / Downloads: 41)
Abstract
AJAX is an acronym for Asynchronous JavaScript And XML. AJAX Is about Better Internet Applications. Web applications have many benefits over desktop applications, they can reach a larger audience, they are easier to install and support, and easier to develop. However, Internet applications are not always as "rich" and user-friendly as traditional desktop applications. With AJAX, Internet applications can be made richer (smaller, faster, and easier to use).AJAX is not a new programming language, but simply a new technique for creating better, faster, and more interactive web applications. AJAX uses JavaScript to send and receive data between a web browser and a web server. The AJAX technique makes web pages more responsive by exchanging data with the web server behind the scenes, instead of reloading an entire web page each time a user makes a change. AJAX is a technology that runs in your browser. It uses asynchronous data transfer (HTTP requests) between the browser and the web server, allowing web pages to request small bits of information from the server instead of whole pages. The technology makes Internet applications smaller, faster and more user-friendly
INTRODUCTION
Once upon a time – in a world before Mashup Camps and online widget platforms like live.com, before Google’s personalized homepage and page flakes, and before JSON, Comet, Dojo, and Apache Derby – there was a term “DHTML” (for dynamic HTML). It was used, as Wikipedia reminds us, for “a collection of technologies, used together to create interactive and animated web sites by using a combination of static markup language (such as HTML), a client-side scripting language (such as JavaScript), the presentation definition language (e.g. Cascading Style Sheets [CSS]), and the Document Object Model.” Recent history has proved that “DHTML” was one letter too many, that the world prefers snappy acronyms to klunky initialisms. Plus there was the small matter of how DHTML scripts often tended to not work well cross-platform. Now that very same approach – JavaScript, CSS, and the DOM, plus the secret sauce of the XMLHttpRequest object to exchange data asynchronously with the web server – is, as we all know, named “AJAX.” And this four-letter word, and the approach it crystallizes
HISTORY
The first use of the term in public was by Jesse James Garrett in February 2005. Although the term "Ajax" was coined in 2005, most histories of the technologies that enable Ajax start a decade earlier with Microsoft's initiatives in developing Remote Scripting. Techniques for the asynchronous loading of content on an existing web page without requiring a full reload date back as far as the IFRAME element type (introduced in Internet Explorer 3 in 1996) and the LAYER element type (introduced in Netscape 4 in 1997, abandoned during early development of Mozilla). Both element types had a src attribute that could take any external URL, and by loading a page containing JavaScript that manipulated the parent page, Ajax-like effects could be attained. This set of client-side technologies was usually grouped together under the generic term of DHTML. Macromedia's Flash could also, from version 4, load XML and CSV files from a remote server without requiring a browser refresh.
Rich Internet Applications
The Internet has changed a lot since its initial creation. It started with simple text-based communication and has built on its past to create ever more powerful means of communicating. In today's World Wide Web, you can create interactive multimedia presentations and powerful applications. Although these applications are powerful, they aren't without their drawbacks. Most are incredibly clumsy when compared to their native application counterparts (Hotmail versus Outlook Express, for instance), and many more have massive usability problems. However, problems or not, the Weband especially Web applicationsis one of the fastest growing and most important fields of software development.
Internet applications bring huge benefits to the table when compared to a normal application. They are highly accessible, require no installation, can be upgraded at any time, and offer access to large amounts of data without complex networks. These advantages allow for a shorter time to market, as well as lower development and support costs, when compared to a native application. Even though Internet applications usually have poorer usability due to their simpler, less interactive interfaces and slow update times, they are replacing native applications everywhere you look.
Technologies of AJAX
If you search the Internet for AJAX, you are likely to notice a large number of items popping up under the AJAX name that don't seem to fit my definition. In most cases, these libraries provide the related functionality needed to finish your AJAX application, but other times, these libraries are just someone trying to jump on the AJAX bandwagon. When looking at these libraries and techniques, I divide them into three groups:
• Those directly used in AJAX
• Those closely related to AJAX
• Those that are just part of the rest of the RIA world
Most of the technologies directly related to AJAX are those that make up the "asynchronous" and the "XML" parts of the AJAX acronym. These are the libraries and techniques that provide the communication layer and the ways to encode the data that moves over it. In many cases, this is the XMLHttpRequest object, but IFrames are also popular, and cookies or embedded ActiveX/Java are yet another possibility. The "X" in AJAX is the technique used in the data encoding, and it's an area with a huge number of possibilities. Data can be transferred as plain text, HTML, XML, or any other type of format that might be convenient for the situation.
THE XMLHTTPREQUEST OBJECT
In a normal Web application, users fill out form fields and click a Submit button. Then, the entire form is sent to the server, the server passes on processing to a script (usually PHP or Java or maybe a CGI process or something similar), and when the script is done, it sends back a completely new page. That page might be HTML with a new form with some data filled in or it might be a confirmation or perhaps a page with certain options selected based on data entered in the original form. Of course, while the script or program on the server is processing and returning a new form, users have to wait. Their screen will go blank and then be redrawn as data comes back from the server. This is where low interactivity comes into play -- users don't get instant feedback and they certainly don't feel like they're working on a desktop application.
BEYOND AJAX
Ambitious developers are already taking advantage of commercial and open-source toolkits to go beyond AJAX to power genuinely asynchronous Web applications — without installing any new software on the client.
Adding genuine asynchronous messaging to the Web is only possible due to some clever interaction between HTML, Javascript, and Web browsers’ rendering algorithms.One of the earliest advances in browser design was to incrementally display a page while it was still downloading. With the invention of nph (‘no-parse-headers’) Common Gateway Interface (CGI) scripts in 1994, Web developers have had ways to ‘pipeline’ data to clients as soon as the server could compute it.The simplest way to exploit this is to turn the browser into a 21st-century “green screen” dumb terminal. Manuel Kiessling’s open-source A Really Simple Chat uses AJAX techniques to send input lines upstream, while a modified HTTP server that can hold open thousands of simultaneous connections re-broadcasts the chat stream to other users. As each line of HTML eventually streams into the browser, it triggers the execution of a new bit of JavaScript that updates the display to insert new lines into the transcript.
CONCLUSION
Rich Internet Applications(RIA) are modern Web applications that provide high levels of interactivity and perform similarly to native applications. RIA is made possible by a number of enabling technologies and techniques. These include JavaScript, DHTML, SVG, and AJAX.
AJAX is a JavaScript technology that provides an extra communication channel with the Web server. AJAX is one of the enabling technologies that allow the creation of RIAs, together with DHTML and other JavaScript techniques; with them, you can make powerful applications that can rival native applications.