Friday, 23 September 2016

Ajax

What's AJAX?

AJAX stands for Asynchronous JavaScript and XML. In a nutshell, it is the use of the XMLHttpRequest object to communicate with server-side scripts. It can send as well as receive information in a variety of formats, including JSON, XML, HTML, and even text files. AJAX’s most appealing characteristic, however, is its "asynchronous" nature, which means it can do all of this without having to refresh the page. This lets you update portions of a page based upon user events.
The two major features of AJAX allow you to do the following:
  • Make requests to the server without reloading the page
  • Receive and work with data from the server

Step 1 – How to make an HTTP request

In order to make an HTTP request to the server using JavaScript, you need an instance of a class that provides this functionality. This is where XMLHttpRequest comes in. Such a class was originally introduced in Internet Explorer as an ActiveX object called XMLHTTP. Then, Mozilla, Safari and other browsers followed, implementing an XMLHttpRequest class that supports the methods and properties of Microsoft's original ActiveX object. Meanwhile Microsoft has implemented XMLHttpRequest as well.
Page Title

This is a Heading

This is a paragraph.

No comments:

Post a Comment