Commit 9e27d8d1 authored by John Resig's avatar John Resig

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

parent d9b1d343
...@@ -778,7 +778,12 @@ $.event = {}; ...@@ -778,7 +778,12 @@ $.event = {};
// Bind an event to an element // Bind an event to an element
// Original by Dean Edwards // Original by Dean Edwards
$.event.add = function(element, type, handler) { $.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 (!handler.$$guid) { handler.$$guid = $.event.add.guid++; }
if (!element.events) { element.events = {}; } if (!element.events) { element.events = {}; }
var handlers = element.events[type]; var handlers = element.events[type];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment