From fe80b5af45049d1c8d10682eb1075f838d52a045 Mon Sep 17 00:00:00 2001 From: John Resig Date: Wed, 22 Jul 2009 14:38:21 +0000 Subject: [PATCH] Make sure that the script is removed only if it's actually in the page still. Fixes #4934. --- src/ajax.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ajax.js b/src/ajax.js index 9a843022c..adae6aec7 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 ); + } } }; } -- 2.39.5