Side navigation
#8483 closed bug (duplicate)
Opened March 09, 2011 01:01PM UTC
Closed March 09, 2011 02:08PM UTC
Last modified March 09, 2011 02:08PM UTC
Using any wrapping function removes `<script type="bogus">` from hierarchy
| Reported by: | krof.drakula@gmail.com | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 1.next |
| Component: | manipulation | Version: | 1.4.4 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
Description
When using jQuery Templates and wrapping an element containing those templates, jQuery's wrap* functions remove all instances of <script> nodes, regardless of type.
While I'm not sure if this is expected behaviour for unknown script types (at least from what I've read in other tickets regarding jQuery.clean), this is a use case that has worked very well when offering templatable widgets.
I've attached a simple case of the widget templating mechanism I use to create such widgets:
http://jsfiddle.net/krofdrakula/dw6RA/
The example fails to attach <p>Correctly replaced</p> to the body, since when .find('script') fires, there are no such elements available in the DOM anymore.