Closed Bug 66240 Opened 24 years ago Closed 24 years ago

Dynamic Script element not supported

Categories

(Core :: DOM: Core & HTML, defect)

x86
Other
defect
Not set
major

Tracking

()

VERIFIED DUPLICATE of bug 18843

People

(Reporter: pbwiz, Assigned: jst)

Details

When a script element is created and attached to the DOM, it is not executed. Example: <html> <head> <title>dom</title> <script language=javascript> function script(){ var myScript = document.createElement("script"); myScript.setAttribute("id", "myScriptElement"); myScript.setAttribute("language", "javascript"); myScript.text = "alert('testing');"; document.documentElement.firstChild.appendChild( myScript ); } </SCRIPT> </head> <body id=mybody> <a href="javascript:script()">Create</a> </body> </html> When the link is clicked, an alert should be displayed. In IE this works. Jeff.
I belief this is a dup of bug 18843, "dynamically added SCRIPT not executable" You may want to look at these two bugs for additional information. 1 - "Cannot dynamically load in external script files and stylesheets" bug 55560 2 - "document.written HTML element not available to external script" bug 63423
good catch, HJ. Marking dup. *** This bug has been marked as a duplicate of 18843 ***
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Component: DOM Level 1 → DOM HTML
QA contact Update
QA Contact: janc → desale
VERIFIED dup
Status: RESOLVED → VERIFIED
Component: DOM: HTML → DOM: Core & HTML
QA Contact: desale → general
You need to log in before you can comment on or make changes to this bug.