Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#6391 closed bug (duplicate)

wrap() bug when wrap javascript

Reported by: Colir Owned by:
Priority: low Milestone: 1.next
Component: manipulation Version: 1.4.2
Keywords: wrap script Cc:
Blocked by: Blocking:


the "wrap()" method re-execute script if the function wrap a div with javascript script

ex: i have javascript in my footer div. if i wrap my main div ( wich contain div header, main and footer), the script in my footer div will be fired twice

Attachments (1)

bug6391.zip (24.6 KB) - added by kaaloo 13 years ago.
Simple html page that reproduces this issue

Download all attachments as: .zip

Change History (7)

comment:1 Changed 13 years ago by dmethvin

Component: unfiledmanipulation

Changed 13 years ago by kaaloo

Attachment: bug6391.zip added

Simple html page that reproduces this issue

comment:2 Changed 13 years ago by kaaloo

Please review the attached zip file which contains a simple html page that reproduces the issue. It would be great if this got fixed for the next point release.

comment:3 Changed 12 years ago by SlexAxton

Keywords: wrap script added; wrap() removed
Priority: low
Status: newopen

I'm not entirely sure that this is fixable. In order to wrap the elements, they have to be momentarily taken out of the dom, and then placed back in. When you inject a script element into the dom, it executes. Perhaps we could play with finding any script elements and removing them entirely before a wrap inject back into the dom. Another option could be to change it's type attribute to something invalid, as to not force an execution. This may be better since it would keep sibling logic consistent, etc...

For now, for those of you having a problem. Just remove the script tag before you wrap the footer. It doesn't have to live in the dom for the code that was in it to keep working... (unless it hasn't run yet).

comment:4 Changed 12 years ago by jitter

Milestone: 1.next
Resolution: duplicate
Status: openclosed

comment:5 Changed 12 years ago by jitter

Duplicate of #7040.

comment:6 Changed 12 years ago by jitter

#8259 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.