Modify ↓
Ticket #11227 (closed bug: duplicate)
unwrap method is triggering ready function twice
| Reported by: | mgambill@… | Owned by: | mgambill@… |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.7.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Change History
comment:1 Changed 16 months ago by sindresorhus
- Owner set to mgambill@…
- Status changed from new to pending
comment:2 Changed 16 months ago by dmethvin
- Status changed from pending to closed
- Resolution set to duplicate
The div you're unwrapping contains the Javascript with ready handler. When it is unwrapped, the script is executed a second time. Since the document is ready, the referenced code runs a second time.
Bug #9134 is essentially the same and has been open a while, but it is hard to fix and also encouraging bad practices. Don't sprinkle Javascript throughout markup and then try to manipulate it.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.
Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.