MDN wants to learn about developers like you:

document.load Redirect 1

There was a scripting error on this page. While it is being addressed by site editors, you can view partial content below.

{{ APIRef }}

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).


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

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

xmlDoc.addEventListener("load", documentLoaded, false);

See also the load sample in the XML tests directory. (Loading the load.html file from the LXR generated page will not work because LXR will munge the test.xml file into HTML and serve it as HTML. To test this functionality, create the files on your local disk or on a webserver.)


See also

Document Tags and Contributors

 Last updated by: Sheppy,