replacing innerHTML removes HEAD and BODY tags - Mozilla
This is a discussion on replacing innerHTML removes HEAD and BODY tags - Mozilla ; Hello,
My extension is a simple button that, when pushed, replaces all of the
content of a web page. Problem is, when the HTML gets inserted, the
HEAD and BODY tags seem to disappear. Here is a brief example:
function ...
-
replacing innerHTML removes HEAD and BODY tags
Hello,
My extension is a simple button that, when pushed, replaces all of the
content of a web page. Problem is, when the HTML gets inserted, the
HEAD and BODY tags seem to disappear. Here is a brief example:
function parsePage () {
window.content.document.documentElement.innerHTML =
"some stufffoo";
}
Resulting rendered source is:
some stuff
foo
Anyone have a clue to what's happening here?
Thanks in advance,
John
-
Re: replacing innerHTML removes HEAD and BODY tags
On Jul 13, 12:11 pm, john wrote:
> Hello,
>
> My extension is a simple button that, when pushed, replaces all of the
> content of a web page. Problem is, when the HTML gets inserted, the
> HEAD and BODY tags seem to disappear. Here is a brief example:
>
> function parsePage () {
> window.content.document.documentElement.innerHTML =
> "some stufffoo";
>
> }
>
> Resulting rendered source is:
>
>
> some stuff
>
> foo
>
> Anyone have a clue to what's happening here?
>
> Thanks in advance,
>
> John
Incidently, this is repeatable using the Shell bookmarklet as:
window.document.documentElement.innerHTML = "some
stuff
foo";
viewing the rendered source via "view source chart".
J