From: John Resig Date: Wed, 22 Jul 2009 14:38:21 +0000 (+0000) Subject: Make sure that the script is removed only if it's actually in the page still. Fixes... X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=fe80b5af45049d1c8d10682eb1075f838d52a045;p=jquery.git Make sure that the script is removed only if it's actually in the page still. Fixes #4934. --- diff --git a/src/ajax.js b/src/ajax.js index 9a84302..adae6ae 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -296,7 +296,9 @@ jQuery.extend({ // Handle memory leak in IE script.onload = script.onreadystatechange = null; - head.removeChild( script ); + if ( head && script.parentNode ) { + head.removeChild( script ); + } } }; }