Re: get HTTP Document with XHR

Boris Zbarsky <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
faj wrote:
> The current code uses the loadURI() to load a page. However, to be able to
> insert custom http request to the header, the new code needs to use the 
> the XMLHttpRequest instead.

Why, exactly?

> After the page is loaded, the following information are needed:
> 
>    var doc = getWebNavigation().document;
>    ....
>    doc.childNodes.length
>    doc.childNodes[...].nodeType
>    doc.childNodes[...].textContent
>    doc.childNodes[...].tagName
>    doc.childNodes[...].attributes[...]....
>    etc.

For an XML document, you can use the responseXML of the XHR.  But if 
it's HTML, you lose.

-Boris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.