Close   

Admin and announcement forums

    30 Mar 2008
introduction to ajax  
kumar rakesh
create and manage free online surveys with unlimited responses
Online surveys are now basic requirement of everyone who want to review there products or to make studies about anything. But finding a solution who can provide esurveys efficiently is really a big pain. creating an online survey with inefficient tool as irritating and getting survey conducted with limitations on responses is even worse.
cont..
    30 Mar 2008
introduction to ajax  
kumar rakesh
practice interviews and prepare for interviews
in todays changing world every one want to increase there salaries very quickly.
Changes your employer is an very efficient solution for this. But changing employer and company is not so easy.

cont..

Viewed 108 times
Total posts : 0

    22 Apr 2008
introduction to ajax  
Ernie Kent
His other forums
introduction to ajax

Here i'm presenting an introduction to ajax.

it is aimed for newbies trying to start with ajax.

ajax is basically used for making requests to server without refreshing html page. so that means, you can fill currently loaded html page, with new contents from server, any time without forcing users to refresh the current page.

ajax stands for Asynchronous Javascript and XML

There are two type of http requests that can be made to server,

one is synchronus and other is synchronus. without going deep in technicals of this, you can think of synchronus, as , your browser will wait, for this request to complete before doing any other task, and asynchronus as, your browser can send and receive as many asynchronus request as you want, without waiting for any request to complete.

Technically speaking, data is transfered from server to client in logical data packet.

These data packets can be in any order, so, in case of synchrouns request browser, will wait to receive all the packets and arrange them in correct order, to be displayed correctely. In case of asynchronus request, data will be displayed, as they are received by browser, without waiting for receiving all the data packets.

Asynchronus requests are in existence from the begining of the http requests and are widely used in vb and other languages. Google has given it a boost in use for browser based applications.

There are differences in initiating ajax request according to differences in browsers.

majorly there are two methods for initializing ajax request

XMLHttpRequest and

ActivexObject("Microsoft.XMLHTTP");

so, to make things crossbrowser, ajax request can be initiated in following way,

var ajxObject = getAjaxObject();

function getAjaxObject(){

  if( window.XMLHttpRequest)

    return new XMLHttpRequest();

  elseif(window.ActiveXObject)

   return ActiveXObject("Microsoft.XMLHTTP");

  else

  return false;

}

 

it will initiate an ajax call to server. This new ajax object ajxObject have some methods to work further on this request.

 

open : this method sends request to server. it has three parameters

1. request method : post, get

2. requested url

3. request mode: false for synchronus request and true for asynchronus request

send : this method will finally send request to server

setRequestHeader : you can set headers for the request using this function.

onreadystatechange : this function is basically event handler and acts on change of status of request on server. There are three states of the request

1 : sending request to server

2 : server recieved the request

3 : server parsing request

4 : server responded to the request.

so, we need to have only status no. 4, on this status, we've received data from server from the requested url.

Received data can be placed in currently loaded page, in any javascript way you like.

Request url page, can be any type of page, an xml, html or php (or any other script created dynamic ) page.

Output in this page must be in xml format, that's why ajax is called, "asynchronus javascript and xml".

Thats it.

There are various articles available on ajax to read and learn ajax. so, to see how ajax works in details, search arouund on google. you will get, thousands of articles on this topic.

thanks.

introduction to ajax introduction to ajax
introduction to ajax Be first to reply this discussion.
introduction to ajax introduction to ajax introduction to ajax

Login to participate in forums
jump to :
Post reply on this forum

Comment on this forum
Name :
Email :
Comments :
Legends
introduction to ajax Forums tagged introduction to ajax Forums tagged. But locked for further reply
="introduction Forums locked. can not accept further replies introduction to ajax General forum