Skip to main content

Bug Tracker

Side navigation

#147 closed bug (fixed)

Opened August 28, 2006 07:18AM UTC

Closed September 15, 2006 02:52PM UTC

Last modified June 20, 2007 02:14AM UTC

Including jQuery again overwrites already registered document-ready events

Reported by: Jörn Owned by:
Priority: major Milestone:
Component: event Version:
Keywords: Cc:
Blocked by: Blocking:
Description

By including jQuery again, all document-ready events are lost. If you can see the text below, the problem still exists. This problem exists in enviroments, where the page author controls only a part of the document, like Portlets (Java JSR 168). While it is possible workaround this by only including jQuery when it is not loaded yet, it would be much more convienent to have that built into jQuery itself.

Example: http://fuzz.bassistance.de/overwriteBug/overwriteBug.html

Attachments (0)
Change History (3)

Changed August 31, 2006 06:28AM UTC by john comment:1

priority: minormajor

Changed September 04, 2006 11:57AM UTC by joern comment:2

It might by suffice to include a check for an existing jQuery variable at the start of the script. Something like:

if(typeof window.jQuery == "undefined") {
// rest of the jQuery code
}

I'm no fan of wrapping the code into one monster if. Is there some kind of return oder quit/exit inside a single javascript file?

Changed September 15, 2006 02:52PM UTC by joern comment:3

resolution: → fixed
status: newclosed

Fixed in SVN, tested in FF 1.5.0.6, IE 5.5 SP2 and IE 6, Opera 9.01, Safari 1.3.x.