]> source.dussan.org Git - jquery.git/commitdiff
Make sure that the script is removed only if it's actually in the page still. Fixes...
authorJohn Resig <jeresig@gmail.com>
Wed, 22 Jul 2009 14:38:21 +0000 (14:38 +0000)
committerJohn Resig <jeresig@gmail.com>
Wed, 22 Jul 2009 14:38:21 +0000 (14:38 +0000)
src/ajax.js

index 9a843022ce7d0fb1476ec48fa37c54c32d0aa695..adae6aec7493b52bcd35a40b78d129affdfce38c 100644 (file)
@@ -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 );
+                                               }
                                        }
                                };
                        }