open method

Creates a connection with a domain's server.

Syntax

var retval = XDomainRequest.open(bstrMethod, bstrUrl);

Parameters

bstrMethod [in]

Type: String

GET

The HTTP GET method.

POST

The HTTP POST method.

bstrUrl [in]

Type: String

The server URL.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Requires an XDomainRequest object.

Examples


  
// 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");     
                

See also

Reference
IHTMLXDomainRequest
XDomainRequest
Other Resources
W3C Architecture: Naming and Addressing: URIs, URLs, ...
RFC2616: Hypertext Transfer Protocol -- HTTP/1.1

 

 

Show:
© 2014 Microsoft