#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: |
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)
Change History (7)
comment:1 Changed 13 years ago by
Component: | unfiled → manipulation |
---|
Changed 13 years ago by
Attachment: | bug6391.zip added |
---|
comment:2 Changed 13 years ago by
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
Keywords: | wrap script added; wrap() removed |
---|---|
Milestone: | 1.4.3 → 1.5 |
Priority: | → low |
Status: | new → open |
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
Milestone: | → 1.next |
---|---|
Resolution: | → duplicate |
Status: | open → closed |
Simple html page that reproduces this issue