XDomainRequest property

Instantiates the XDomainRequest object for the window.

 

Syntax

HRESULT value = object.put_XDomainRequest(VARIANT v);HRESULT value = object.get_XDomainRequest(VARIANT* p);

Property values

Type: VARIANT

VARIANT of type VT_DISPATCH that receives the IHTMLXDomainRequestFactory that creates a new XDomainRequest object.

Remarks

If the IHTMLXDomainRequest feature has been disabled, parameter p will point to a VARIANT of type VT_EMPTY. See CoInternetIsFeatureEnabled.

If the cross-domain request feature has been disabled in Windows Internet Explorer, the property value is set to NULL.

The IHTMLWindow6::XDomainRequest property was introduced in Windows Internet Explorer 8.

Examples

The following script demonstrates how to create and use the XDomainRequest object.

if (window.XDomainRequest)
{
   var oReq = new XDomainRequest();
   if (oReq) {
      oReq.open("GET", "http://example.com/test.xml");
      oReq.send();
      alert(oReq.statusText);
   }
}