Open Bug 304786 Opened 19 years ago Updated 2 years ago

dynamically inserting/adding xul:script via DOM doesn't work

Categories

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

defect

Tracking

()

People

(Reporter: js177634, Unassigned)

References

()

Details

Attachments

(1 file)

516 bytes, application/vnd.mozilla.xul+xml
Details
User-Agent:       Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.7.10) Gecko/20050730 Firefox/1.0.6 (Debian package 1.0.6-2)
Build Identifier: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.7.10) Gecko/20050730 Firefox/1.0.6 (Debian package 1.0.6-2)

When adding a <script> node to a document dynamically (from within JavaScript),
the behaviour between HTML and XUL differs. In HTML, the contained JavaScript
code is executed. In XUL, it is not.
In order to write dynamic XUL applications, it would be helpful to have the
added JavaScript nodes executed as well.
The two testcase files demonstrate the behaviour: With HTML, a message box pops
up, while with XUL, the node gets added (as can be confirmed with DOM
Inspector), but no message box appears.

Reproducible: Always
confirm with a 2005-08-15 deerpark build on winxp, over to dom
Assignee: nobody → general
Status: UNCONFIRMED → NEW
Component: General → DOM: Core
Ever confirmed: true
OS: Linux → All
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → Trunk
The basic problem is that xul:script is not implemented in the content node (because nothing in XUL is!) but in the XUL parser...
A workaround until this is fixed:

change 

document.createElement('script')

to

document.createElementNS('http://www.w3.org/1999/xhtml', 'script')

This should work fine even in XUL documents.
Summary: Adding JavaScript dom nodes in XUL doesn't work → Adding xul:script dynamically via DOM doesn't work
Summary: Adding xul:script dynamically via DOM doesn't work → dynamically inserting/adding xul:script via DOM doesn't work
Component: DOM: Core → DOM: Core & HTML
QA Contact: ian → general
Assignee: general → nobody
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: