Closed
Bug 147581
Opened 22 years ago
Closed 22 years ago
Script linked by using innerHTML does not get evaluated
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: ddumitriu, Assigned: jst)
References
Details
Attachments
(4 files)
I have an empty DIV in the document. At some point, I dynamically create an
IFRAME in which I load a different document. Upon loading, this document (the
one in the IFRAME) identifies the DIV in the parent document and sets its
innerHTML property to some html which also includes a linked script (with src=).
Then the IFRAME is destroyed.
The html is rendered ok in the DIV, but the script it references does not get
evaluated. Functions or variables defined in it are not accessible. However, the
JavaScript Debugger will see the script and its contents.
This behavior was introduced in 1.0RC3. Everything worked fine in 0.9.8. IE6.0
does not seem to parse the script either.
Reporter | ||
Comment 1•22 years ago
|
||
Load this document in the browser. The other files are referenced by this one.
Reporter | ||
Comment 2•22 years ago
|
||
Reporter | ||
Comment 3•22 years ago
|
||
Reporter | ||
Comment 4•22 years ago
|
||
Assignee | ||
Comment 5•22 years ago
|
||
Right, IE doesn't execute scripts in .innerHTML either, and that's the reason
for Mozilla not doing it. This is as designed, <script> tags are not executed
(nor are external scripts loaded) when they appear in .innerHTML. INVALID.
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Comment 6•21 years ago
|
||
See also bug 127016, "appendChild(cloneNode(true)) causes inline scripts to
execute again".
Comment 7•19 years ago
|
||
*** Bug 320226 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•