Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
HTML and CSS
Properties
 XMLHttpRequest Property
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 What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
The description is incorrect      yecril   |   Edit   |   Show History

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

Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker