4 out of 13 rated this helpful - Rate this topic

XMLHttpRequest property

Instantiates the XMLHttpRequest object for the window.

Syntax

JavaScript

p = object.XMLHttpRequest

Property values

Type: Object

the XMLHttpRequest.

Standards information

Remarks

Despite its name, this method does not return an XMLHttpRequest object directly. Instead, it returns an IHTMLXMLHttpRequestFactory, which can be used to create an XMLHttpRequest object.

If the FEATURE_XMLHTTPREQUEST feature has been disabled, this method will return a Variant of type null. See CoInternetIsFeatureEnabled.

If the cross-domain request feature has been disabled in Windows Internet Explorer, this method returns null.

XMLHttpRequest was introduced in Windows Internet Explorer 7

Examples

The following script demonstrates how to create and use the XMLHttpRequest object:


if (window.XMLHttpRequest)
{
   var oReq = new XMLHttpRequest();
   if (oReq) {
      oReq.open("GET", "http://localhost/test.xml");
      oReq.send();
      console.log(oReq.statusText);
   }
}

See also

window
create

 

 

Send comments about this topic to Microsoft

Build date: 11/29/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.