Opened 15 years ago
Closed 14 years ago
#1555 closed bug (duplicate)
Scripts execute before being put into the document
Reported by: | fstorm | Owned by: | john |
---|---|---|---|
Priority: | major | Milestone: | 1.2 |
Component: | ajax | Version: | 1.1.4 |
Keywords: | script | Cc: | |
Blocked by: | Blocking: |
Description
In jQuery 1.1.4 scripts get automatically evaluated when they're attached to the DOM. But they're also evaluated when they're attached to elements which are not part of the document DOM yet. I think scripts shouldn't be evaluated until they're attached to the document DOM.
Simple test:
function test() { var test_script = "<script type=\"text/javascript\">alert(\"hello!\");</script>"; var test_elem = jQuery("<div></div>"); test_elem.html(test_script); }
When executed, this function displays the alert "hello!". I think it shouldn't unless you insert test_elem into the document DOM.
This breaks compatibility between 1.1.3.1 and 1.1.4 on my website.
Change History (4)
comment:1 Changed 15 years ago by
Owner: | set to john |
---|
comment:2 Changed 15 years ago by
Component: | core → ajax |
---|
comment:3 Changed 14 years ago by
Keywords: | script added |
---|---|
Summary: | automatic script evaluation → Scripts execute before being put into the document |
comment:4 Changed 14 years ago by
Resolution: | → duplicate |
---|---|
Status: | new → closed |
going to go ahead and close this as a duplicate of #3105 to conslidate
Note: See
TracTickets for help on using
tickets.
See also #3105