From ea5d51400820585a6d31011e1a1109c5a1213360 Mon Sep 17 00:00:00 2001 From: jeresig Date: Thu, 31 Dec 2009 00:49:53 -0500 Subject: [PATCH] When .bind('unload') was called it accidentally went recursive, from 1bac61655b6c323ab4bcfc65b0d95c1587dd8503. Fixes #5688. --- src/event.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/event.js b/src/event.js index 79a6b9529..0bf7d90ba 100644 --- a/src/event.js +++ b/src/event.js @@ -778,9 +778,11 @@ jQuery.each(["bind", "one"], function( i, name ) { jQuery( this ).unbind( event, handler ); return fn.apply( this, arguments ); }) : fn; - return type === "unload" ? this.one(type, data, handler, thisObject) : this.each(function() { - jQuery.event.add( this, type, handler, data ); - }); + return type === "unload" && name !== "one" ? + this.one( type, data, fn, thisObject ) : + this.each(function() { + jQuery.event.add( this, type, handler, data ); + }); }; }); -- 2.39.5