Skip to main content

Bug Tracker

Side navigation

#11227 closed bug (duplicate)

Opened January 26, 2012 08:49AM UTC

Closed January 26, 2012 02:14PM UTC

Last modified January 26, 2012 02:24PM UTC

unwrap method is triggering ready function twice

Reported by: mgambill@nmyvision.com Owned by: mgambill@nmyvision.com
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

reproducible here

http://jsbin.com/afuzam/2/edit

if you remove the outer div everything works fine.

Attachments (0)
Change History (4)

Changed January 26, 2012 12:40PM UTC by sindresorhus comment:1

owner: → mgambill@nmyvision.com
status: newpending

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.

Changed January 26, 2012 02:14PM UTC by dmethvin comment:2

resolution: → duplicate
status: pendingclosed

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.

Changed January 26, 2012 02:14PM UTC by dmethvin comment:3

Duplicate of #9134.

Changed January 26, 2012 02:24PM UTC by anonymous comment:4

I'm working in .Net project so some of final html created its necessary to have inline script. With that being said I would prefer you guys not fix it and just add a comment about it in the API documentation.