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 9a84302..adae6ae 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 );
+                                               }
                                        }
                                };
                        }