diff --git a/src/event.js b/src/event.js index 1bbf1348d..8a40d0020 100644 --- a/src/event.js +++ b/src/event.js @@ -286,7 +286,7 @@ jQuery.event = { delete elemData.handle; if ( typeof elemData === "function" ) { - jQuery.removeData( elem, "events" ); + jQuery.removeData( elem, eventKey ); } else if ( jQuery.isEmptyObject( elemData ) ) { jQuery.removeData( elem ); diff --git a/test/unit/event.js b/test/unit/event.js index b37b253a8..6f753225d 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -1838,7 +1838,7 @@ test("window resize", function() { ok( true, "Resize event fired." ); }).resize().unbind("resize"); - ok( !jQuery(window).data("events"), "Make sure all the events are gone." ); + ok( !jQuery(window).data("__events__"), "Make sure all the events are gone." ); }); /*