Skip to main content

Bug Tracker

Side navigation

#6391 closed bug (duplicate)

Opened April 02, 2010 11:13AM UTC

Closed February 13, 2011 01:48AM UTC

Last modified February 13, 2011 01:48AM UTC

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:
Description

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 September 15, 2010 04:54PM UTC.

    Simple html page that reproduces this issue

Change History (6)

Changed June 12, 2010 02:54AM UTC by dmethvin comment:1

component: unfiledmanipulation

Changed September 15, 2010 04:55PM UTC by kaaloo comment:2

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.

Changed October 23, 2010 09:37PM UTC by SlexAxton comment:3

keywords: wrap()wrap script
milestone: 1.4.31.5
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).

Changed February 13, 2011 01:48AM UTC by jitter comment:4

milestone: → 1.next
resolution: → duplicate
status: openclosed

Changed February 13, 2011 01:48AM UTC by jitter comment:5

Duplicate of #7040.

Changed February 13, 2011 01:48AM UTC by jitter comment:6

#8259 is a duplicate of this ticket.