This topic has not yet been rated Rate this topic

IHTMLXDomainRequest Interface

Implements cross-domain Asynchronous JavaScript and XML (AJAX) requests between the browser and a server.

IHTMLXDomainRequest Members

abort The abort method terminates a pending IHTMLXDomainRequest::send.
contentType Gets the Content-Type property in the HTML request or response header.
onerror Gets or sets the method to handle the onerror event.
onload Gets or sets the method to handle the onload event.
onprogress Gets or sets the method to handle the onprogress event.
ontimeout Gets or sets the method to handle the ontimout event.
open Creates a connection with a domain's server.
responseText Contains the body of the response returned by the server.
send Transmits a data string to the server for processing.
timeout Gets or sets the value of the timeout property.

Remarks

Cross-domain requests require mutual consent between the Web page and the server. You can initiate a cross-domain request by creating an XDomainRequest (XDR) object with the window object, and opening a connection to a URL. When sending the request, Windows Internet Explorer 8 includes an XDomainRequest: 1 HTTP request header. The connection is completed only if the server responds with an XDomainRequestAllowed: 1 response header.

To use the XDR protocol, you first create an XDomainRequest object. Then you use the open method to establish a connection with a server. Once a connection is opened, the send method transmits data strings to the server for processing. For example:


  
// 1. Create XDR object 
xdr = new XDomainRequest(); 

// 2. Open connection with server using POST method
xdr.open("POST", "http://www.contoso.com/xdr.txt");

// 3. Send string data to server
xdr.send("data to be processed");     
                

For more information, see XDomainRequest.

Interface Information

Stock Implementation mshtml.dll
Custom Implementation No
Inherits from IDispatch
Header and IDL files mshtml.h, mshtml.idl
Minimum availability Internet Explorer 8
Minimum operating systems Windows XP SP2

See Also

Introducing Cross-domain Request
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ