Properties


XMLHttpRequest Property

Instantiates the XMLHttpRequest object for the window.

Syntax

[ oRequest = ] window.XMLHttpRequest

Possible Values

oRequest Object that receives the XMLHttpRequest.

The property is read-only. The property has no default value.

Remarks

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

XMLHttpRequest was introduced in Internet Explorer 7

Example

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();
      alert(oReq.statusText);
   }
}

Standards Information

This property is defined in The XMLHttpRequest Object (W3C Working Draft) World Wide Web link.

Applies To

window
Tags :


Community Content

yecril
The description is incorrect

Syntax

Set oFactory = window.XMLHttpRequest

Possible Values

oFactory contains a reference to an XML HTTP Request Factory for HTML

Remarks

The object exposes the interface IHTMLXMLHttpRequestFactory; it is undocumented and JScript uses it intrinsicly.
However, the following code does not work in VBScript:

REM Set oReq = new XMLHttpRequest

Example

dim oReq


if window.XMLHttpRequest then


















set oReq to window.XMLHttpRequest.Create
oReq.open "GET", "http://localhost/test.xml"
oReq.send
window.alert oReq.statusText
end if


Page view tracker