go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  Step 1) Create an XMLHttpRequest object
 
Subject: Step 1) Create an XMLHttpRequest object
Author: WebSpider
In response to: How does AJAX work?
Posted on: 11/10/2009 10:22:41 PM

<script language="javascript">
function getXmlHttpObject()
{
    if (window.XMLHttpRequest)
    {
        // for IE7+, Firefox, Chrome, Opera, Safari
        return new XMLHttpRequest();
    }
    if (window.ActiveXObject)
    {
        // for IE6, IE5
        return new ActiveXObject("Microsoft.XMLHTTP");
    }
    return null;
}
</script>


 

> On 11/10/2009 10:21:39 PM WebSpider wrote:

The keystone of AJAX is the XMLHttpRequest object (IE5 and IE6 uses ActiveXObject).

By using the XMLHttpRequest object, your JavaScript communicates directly with the server for data and asynchronously proceeds with other tasks while waiting for the response from the server.





References:

 


 
Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.