abort Method (DOMDocument)
Aborts an asynchronous download in progress.
[Script]
Script Syntax
oXMLDOMDocument.abort();
Example
var xmlDOM; xmlDOM = new ActiveXObject("Msxml2.DOMDocument50"); xmlDOM.async = true; xmlDOM.onreadystatechange = doOnReadyStateChange; xmlDOM.load("books.xml"); if (xmlDoc.parseError.errorCode != 0) { var myErr = xmlDoc.parseError; alert("You have error " + myErr.reason); } function doOnReadyStateChange () { if (xmlDOM.readyState == 1) { xmlDOM.abort(); } }
[Visual Basic]
Visual Basic Syntax
oXMLDOMDocument.abort
Example
Dim WithEvents xmlDOM As Msxml2.DOMDocument50 Private Sub cmddoAbortDOMDocument_Click() Set xmlDOM = New Msxml2.DOMDocument50 xmlDOM.async = True xmlDOM.Load "books.xml" If (xmlDoc.parseError.errorCode <> 0) Then Dim myErr Set myErr = xmlDoc.parseError MsgBox("You have error " & myErr.reason) End If End Sub Private Sub xmlDOM_onreadystatechange() If xmlDOM.readyState = 1 Then xmlDOM.abort End If End Sub
[C/C++]
C/C++ Syntax
HRESULT abort( void );
C/C++ Return Values
- S_OK
- The value returned if successful.
Remarks
This method stops download and parsing and discards any portion of the XML tree already built. IXMLDOMParseError
indicates that the download was stopped.
If the readyState
property has the value COMPLETED
, no action is taken and the current document is unchanged.
This member is an extension of the Worldwide Web Consortium (W3C) Document Object Model (DOM).
To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button in the upper-left corner of the page.
See Also
IXMLDOMParseError | readyState Property (DOMDocument)
Applies to: DOMDocument