Saturday, July 24, 2010

AJAX

Ajax is powerful tool for making your web application faster more userfriendly. Javascript cannot communicate with server but Ajax makes it possible. Javascript can communicate with web server using XMLHttpRequest object. With the help of this we can pass request to the server in background. Because of this user gets faster response from server & need not reload whole page. 
Ajax is technique of changing the part of web page without reloading the whole page. We can request text, XML, php, aspx, html or any file from the server.
Disadvantages of Ajax
* Ajax based web pages cannot be indexed by search engines because search engine neglects code written in javascript.
* Bookmarking not works with Ajax based web pages. You can bookmark but it doesnt work the way you expect.
* Security problem Ajax code is visible to everyone you need tobe validat data coming from browers.
* I heard it might not work properly in slow internet speed.

Difference between true & false
when we call open() method of XMLHttpRequest object it takes third parameter either true or false.
false tells  XMLHttpRequest object to wait until request is completed before executing the next statement.
It is ok when request or application is simple but is request is long then application hang or stop.

True tells that continue the execution after the request to the server has been sent. With this you cant sure about response from server so that you have to use onreadystatechange property.

I heard about AJAX is differnt technologies can communicate.
AJAX is easy to learn it is not new language it is based on existing standard. check w3schools for more details.....


--
Amol.....
9595991644

No comments:

Post a Comment