XMLDocument.load()

document.load() is a part of an old version of the W3C DOM Level 3 Load & Save module. Can be used with document.async to indicate whether the request is synchronous or asynchronous (the default). As of at least Gecko 1.9, this no longer supports cross-site loading of documents (Use XMLHttpRequest instead).

Examples

JavaScript
var xmlDoc = document.implementation.createDocument("", "test", null);

function documentLoaded (e) {
  alert(new XMLSerializer().serializeToString(e.target)); // Gives querydata.xml contents as string
}

xmlDoc.addEventListener("load", documentLoaded, false);
xmlDoc.load('querydata.xml');

See also the load sample in the XML tests directory. (To test this functionality, create the files on your local disk or on a webserver rather than loading the load.html file from the LXR-generated page, which will serve the text.xml file as HTML.)

Specification

See also

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/xmldocument/load

API Deprecated DOM Experimental Expérimental Method Reference Référence