Skip to main content

Bug Tracker

Side navigation

#7040 closed bug (invalid)

Opened September 16, 2010 08:08AM UTC

Closed September 22, 2010 10:25PM UTC

Last modified February 13, 2011 01:48AM UTC

wrap on div with javascript re-executes the javascript

Reported by: peet Owned by:
Priority: Milestone: 1.4.3
Component: manipulation Version: 1.4.2
Keywords: wrap reloads event twice Cc:
Blocked by: Blocking:
Description

if i put a document.ready event inside a div, and then wrap the div with an other element, the document.ready event is triggered again.

the strange behavior is only happening ones. If it was intended i expect it to happen on every wrap instead it happens only the first time.

See my example, when a click event is registered to a button. the first time it is clicked, it is triggered once, after that it is triggered twice. but never more then 2 times.

Attachments (1)
  • jquerytest.html (0.4 KB) - added by peet September 16, 2010 08:09AM UTC.

    the first time clicked 1 event after that 2 events

Change History (2)

Changed September 22, 2010 10:25PM UTC by snover comment:1

resolution: → invalid
status: newclosed

This is expected behaviour. jQuery will remove and execute separately script blocks inside HTML that is manipulated by jQuery. See jQuery.clean.

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

#6391 is a duplicate of this ticket.