Você está na página 1de 3

Introduction What is Ajax? History Why use Ajax? Ajax as a combination of Technologies How Ajax works?

Advantages Drawbacks Future Conclusion References

Internet is very important technology in this era. Most of students, teachers and computer users are using this technology. However, there are some problems with this technology. Because of interacting with some servers across the world, this procedure makes the interacting not that fast. Web-designers and Internet developers try to solve this problem by many ways. One of these ways is design new web-programming languages such as JavaScript or XML. Unfortunately, these new ways solve a part of these problems but the other parts still face problems. Some scientists say that if there is an ideal solvent to this problem, the people life will depend almost completely on the computers. Here we are going to tell you about a new technology called Ajax that has been solving big part of problems with browsing the Internet. Ajax is actually a family of technologies that have been available for years. The means to make requests to the server using only JavaScript were built into Internet Explorer 5.5, but the possibilities of the technology were overlooked. It was only in 2005 that the techniques were rediscovered and used, notably to excellent effect in Googles Gmail web application.

AJAX (shorthand for Asynchronous JavaScript and XML): Asynchronous: This means that when you send a request, you wait for the response to come back, but are free to do other things while you wait. The response probably wont come back immediately, so you set up a function that will wait for the response to be sent back by the server, and react to it once that happens. JavaScript: JavaScript is used to make a request to the server. Once the response is returned by the server, you will generally use some more JavaScript to modify the current pages document object model in some way to show the user that the submission went through successfully. XML: The data that you receive back from the server will often be packaged up as a snippet of XML, so that it can be easily processed with JavaScript. This data can be anything you want, and as long as you want. Ajax is a group of interrelated web development techniques used on the client-side to create interactive web applications or rich Internet applications. With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. The use of Ajax has led to an increase in interactive or dynamic interfaces on web pages and better quality of Web services due to the asynchronous mode. Data is usually retrieved using theX M LHttpR equest object. Despite the name, the use of JavaScript and XML is not actually required, nor do the requests need to be asynchronous.

Techniques for the asynchronous loading of content date back to the mid 1990s. Java applets were introduced in the first version of the Java language in 1995. These allow compiled client- side code to load data asynchronously from the web server after a web page is loaded. In 1996, Internet Explorer introduced the IFrame element to HTML, which also enables this to be achieved. In 1999, Microsoft created the XMLHTTP ActiveX control in Internet Explorer 5, which is now supported by Mozilla, Safari and other browsers as the native XMLHttpRequest object. However, this feature only became widely known after being used by Gmail (2004) and Google Maps (2005). Ajax is only a name given to a set of tools that previously existed. The main part is XMLHttpRequest, a server-side object usable in JavaScript that was implemented into Internet Explorer since the 4.0 version. In Internet Explorer it is an ActiveX object that was first named XMLHTTP sometimes, before to be generalized on all browsers under the name XMLHttpRequest, when the Ajax technology becomes commonly used. The use of XMLHttpRequest in 2005 by Google, in Gmail and Google Maps has contributed to the success of this format. But this is the when the name Ajax was itself coined that the technology started to be so popular.

WHY USE AJAX? Mainly AJAX is used to build a fast, dynamic website, and also to save resources. For improving sharing of resources, it is better to use the power of all the client computers rather than just a unique server and network. Ajax allows performing processing on client computer (in JavaScript) with data taken from the server. The processing of web page formerly was only server-side, using web services or PHP scripts, before the whole page was sent within the network. But Ajax can selectively modify a part of a page displayed by the browser update it without the need to reload the whole document with all images, menus, etc. For example, fields of forms, choices of user, may be processed and the result displayed immediately into the same page.

AJAX AS A COMBINATION OF TECHNOLOGIES The term Ajax has come to represent a broad group of web technologies that can be used to implement a web application that communicates with a server in the background, without interfering with the current state of the page: HTML and CSS for presenting. JavaScript for local processing, and DOM (Document Object Model) to access data inside the page or to access elements of XML file read on the server The XMLHttpRequest object is used to read or send data on the server asynchronously. Optionally: DOM Parser may be used. PHP or another scripting language may be used on the server. XML and XSLT to process the data if returned in XML form.

HOW AJAX WORKS? Ajax uses a programming model with display and events. These events are user actions; they call functions associated to elements of the web page. Interactivity is achieved with forms and buttons. DOM allows to link elements of the page with actions and also to extract data from XML files provided by the server. To get data on the server, XMLHttpRequest provides two methods: - open: create a connection. - send: send a request to the server. Data furnished by the server will be found in the attributes of the XMLHttpRequest object: - responseXml for an XML file or - responseText for a plain text. Take note that a new XMLHttpRequest object has to be created for each new file to load. We have to wait for the data to be available to process it, and in this purpose, the state of availability of data is given by the readyState attribute of XMLHttpRequest