Here is the description of Ajax from Wikipedia:
To use XMLHttpRequest, you must understand the three ways of creating an XMLHttpRequest object:
- IE 5: request = new ActiveXOjbect(“MIcrosoft.XMLHPPT”)
- IE 6+: request = new ActiveXObject(“Msxml2.XMLHTTP”)
- All others: new XMLHttpRequest()
Therefore, the code below will work for all major browsers released over the last few years.
//A cross-browser Ajax function
try //Non-IE browser?
var request = new XMLHttpRequest()
try //IE 6+?
request = new ActiveXObject("Msxml2.XMLHTTP")
try //IE 5?
REQUEST = NEW ActiveXObject("Microsoft.XMLHTTP")
catch(e3) //There is no Ajax support
request = false
|onreadystatechange||Specified an event handing function to be called whenever the readyState property of an object changes.|
|readyState||An integer property that reports on the status of a request. It can have any of these values:
0 = Uninitialized
1 = Loading
2 = Loaded
3 = Interactive
4 = Completed
|responseText||The data returned by the server in text format.|
|responseXML||The data returned by the server in XML format.|
|status||The HTTP status code returned by the server.|
|statusText||The HTTP status text returned by the server.|
|abort()||Aborts the current request|
|getAllResponseHeaders()||Returns all headers as a string|
|getResponseHeader(param)||Returns the value of param as a string|
|open(‘method‘,’url‘,’asynch‘)||Specifies the HTTP method to use (GET or POST), the target URL, and whether the request should be handled asynchronously (true or false)|
|send(data)||Sends data to the tareget server using the specified HTTP method|
|setRequestHeader(‘param‘,’value‘)||Sets a header with a parameter/value pair|