Custom Search

Basics of AJAX - Part 2

In the previous article we discussed on the concept of coding and methods getting used in Ajax Operation. In this we will go deep inside the XMLHttp Object and other issues on AJAX Programming.





XMLHttpRequest Object Methods:

XMLHttpRequest Object Properties:

Example of using GET Method

xmlhttp.open("GET",url,true)
xmlhttp.send(null)

Example of using POST Method

xmlhttp.open("POST",url, true);
xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded;charset=UTF-8;');
xmlhttp.send('hello=world&XMLHttpRequest=test');

Here we setting the header for application data having character set as UTF-8. Also we are sending two variable hello and XMLHttpRequest having values world and test.

FAQ on AJAX:

Caching in AJAX
Browsers caches the data send through GET methods (i.e through querystring in Temporary Internet Folder). To overcome this situation following methods can be used.

Similar Posts

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

Comments

Thank you for sharing!

Leave a comment

(required)

(required)