Skip to content
Permalink
Browse files

Changed the window.location hack to be more specific (and documented).

  • Loading branch information
jeresig committed Jun 16, 2006
1 parent d9b1d34 commit 9e27d8d1b4d5a93ef4107aab5e815a2c24ed899d
Showing with 6 additions and 1 deletion.
  1. +6 −1 jquery/jquery.js
@@ -778,7 +778,12 @@ $.event = {};
// Bind an event to an element
// Original by Dean Edwards
$.event.add = function(element, type, handler) {
if ( element.location ) { element = window; } // Ughhhhh....
// For whatever reason, IE has trouble passing the window object
// around, causing it to be cloned in the process
if ( $.browser == "msie" && typeof element.setInterval != "undefined" ) {
element = window;
}

if (!handler.$$guid) { handler.$$guid = $.event.add.guid++; }
if (!element.events) { element.events = {}; }
var handlers = element.events[type];

0 comments on commit 9e27d8d

Please sign in to comment.
You can’t perform that action at this time.