Ticket #11135 (closed bug: cantfix)
clean() misbehaves for self-referencing scripts
|Reported by:||andrew_sayers||Owned by:|
Tested in Firefox 9.0.1/Linux
Script tags of the form <script class="foo">$(".foo")...</script> are a useful alternative to document.write() when you want to e.g. $(element).load() a document, but don't work because the <script> tag is deleted while $.clean() looks to execute it.
Steps to replicate:
- Go to http://jsfiddle.net/nvmkf/
- Click "Run"
- Expected: "Inserted string" appears twice in the result
Observed: "Inserted string" only appears once
As well as running scripts explicitly, script tags should be included in the DocumentFragment so the script can refer to the tag it's in.