Bug Tracker

Modify

Ticket #7040 (closed bug: invalid)

Opened 4 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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

jquerytest.html Download (441 bytes) - added by peet 4 years ago.
the first time clicked 1 event after that 2 events

Change History

Changed 4 years ago by peet

the first time clicked 1 event after that 2 events

comment:1 Changed 4 years ago by snover

  • Status changed from new to closed
  • Resolution set to invalid

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

comment:2 Changed 3 years ago by jitter

#6391 is a duplicate of this ticket.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.