[Greasemonkey] Alternative to innerHTML?

Aaron Boodman zboogs at gmail.com
Thu Jul 28 19:31:09 EDT 2005

> The DOMParser object has a function parseFromString that returns an
> XMLDocument.. and its child is an Element Object.. which doesn't seem
> to want to be a html thing ;)

To get around this, you can create an IFRAME, document.write() the
HTML contents into it, then extract the documentElement.

I'm not sure how it will react to document.write()ing invalid HTML. It
probably handles it more gracefully than innerHTML.

More information about the Greasemonkey mailing list