Saturday, August 2, 2008

How AJAX Works

The best way to learn this topic to understand the comparison between the traditional method of calling the Web page from the server and AJAX methodology.


Traditional WebPage Call

  • User interacts with the webpage to perform its operation
  • The request is submitted to the Web Server along with the information user wants
  • Server checks for the details and might require to interact with the Database and finally returns the response to the browser
  • Browser displays the user response details in the form of refreshing the webpage

Traditional WebPage Call

* User has to wait until the page reloads
* User can perform only one action at a time

AJAX come to the rescue:
With AJAX user can fetch the data from the server without refreshing the whole page. During AJAX call following steps are followed

* User interacts with the web page to perform its operation. At this point your webpage internally through JavaScript calls a remote file and the user data is passed through GET/POST method
* The web server receives the request processes it and send the data back to the client browser
* At this point the web page is not reloaded and the browser JavaScript engine is waiting for the response from the web server.
* The web page gets the response from the server and dynamically through JavaScript displays the content fetched from the server

Advantage of using AJAX:

* Make multiple AJAX calls with different request from the same page
* Instant result
* Not to wait for the page to get reload

Ready for going deep into AJAX Programming, if yes than check out the links below.
Bookmark It

1 comment:

Forex Analysis said...

this good site
http://an-noor.yolasite.com/
thanks