Article From:https://www.cnblogs.com/0410ZXY/p/9967736.html

AJAXadvantage

1.No plug-in operation is required

2.Excellent user experience

3.Improving the Performance of Web Programs

4.Reducing the burden of servers and broadband

AJAXDeficiency

1.Browser’s inadequate support for XMLHttpRequest objects

2.Destroy the normal functionality of Browser Forward and Backward

3.Deficiencies in Support of Search Engines

4.Lack of development and debugging tools

 

Step 1: Create an XMLHttpRequest object
Var xmlHttp;
function createXMLHttpRequest()
{
  if(window.ActiveXObject)//IE5.Or IE6’s IE kernel.
  {xmlHttp=new ActiveXObject(“Microsoft.XMLHTTP”);}
  else //Firefox Mozilla, etc.
  {xmlHttp=new XMLHttpRequest();}
}

 

Step 2: Send AJAX requests asynchronously and accept the returned content
function  GetResult()
{
createXMLHttpRequest();
xmlHttp.open(“get”,”test.aspx?name=rao”,true);
xmlHttp.onreadystatechange=RequestCallBack;
xmlHttp.send(null);
}

 

Step 3: Determine the return status and receive data
function RequestCallBack()
{
 if(xmlHttp.readystate==4 &&xmlHttp.status==200)
 {       alert(xmlHttp.responseText);
 }
 }

 

Link of this Article: JQuery AJAX operation

Leave a Reply

Your email address will not be published. Required fields are marked *