What is the best way to parse (get a DOM tree of) a HTML result of XmlHttpRequest in Firefox?
EDIT:
I do not have the DOM tree, I want to acquire i
At least for newer Firefox versions, an easier way is or will soon be available.
https://developer.mozilla.org/en/HTML_in_XMLHttpRequest indicates that starting from FF11 it will be possible to ask for a DOM directly from the XHR by setting the responseType
attribute to "document"
. At that point, the HTML will be parsed and the DOM stuck into responseXML
as for an XML document.