abort Method (IXMLHTTPRequest)

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - DOM Reference

abort Method (IXMLHTTPRequest)

Cancels the current HTTP request.

[Script]

Script Syntax

oXMLHttpRequest.abort();

Example

var xmlhttp;
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.5.0");
xmlhttp.onreadystatechange = doHttpReadyStateChange;
xmlhttp.open("GET", "http://localhost/sample.xml", true);
xmlhttp.send();

function doHttpReadyStateChange() {
   if (xmlhttp.readyState == 2) {
      xmlhttp.abort();
   }
}
[Visual Basic]

Visual Basic Syntax

oXMLHttpRequest.abort
[C/C++]

C/C++ Syntax

HRESULT abort(void);

C/C++ Return Values

S_OK
The value returned if successful.

Remarks

The request will be returned to the UNINITIALIZED state, and open method must be called next.

To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

readyState Property (IXMLHTTPRequest) | open Method (IXMLHTTPRequest)

Applies to: IXMLHTTPRequest