From 92766654ae71e653e12ea4b0e43764cdf7b29a79 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 9 Aug 2011 11:45:41 -0400 Subject: [PATCH] Widget: Wrap the remove event trigerring in a try/catch. Fixes #7510 - jQuery.data throws a script error in certain circumstances. --- ui/jquery.ui.widget.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index a66b8a54a..4c538d020 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -14,7 +14,10 @@ var slice = Array.prototype.slice; var _cleanData = $.cleanData; $.cleanData = function( elems ) { for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { - $( elem ).triggerHandler( "remove" ); + try { + $( elem ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} } _cleanData( elems ); }; -- 2.39.5