Index: trunk/phase3/resources/mediawiki/mediawiki.js |
— | — | @@ -648,17 +648,21 @@ |
649 | 649 | |
650 | 650 | done = true; |
651 | 651 | |
652 | | - // Handle memory leak in IE |
653 | | - script.onload = script.onreadystatechange = null; |
654 | | - |
655 | 652 | callback(); |
656 | 653 | |
657 | | - if ( script.parentNode ) { |
658 | | - script.parentNode.removeChild( script ); |
659 | | - } |
660 | | - |
661 | | - // Dereference the script |
662 | | - script = undefined; |
| 654 | + // Handle memory leak in IE. This seems to fail in |
| 655 | + // IE7 sometimes (Permission Denied error when |
| 656 | + // accessing script.parentNode) so wrap it in |
| 657 | + // a try catch. |
| 658 | + try { |
| 659 | + script.onload = script.onreadystatechange = null; |
| 660 | + if ( script.parentNode ) { |
| 661 | + script.parentNode.removeChild( script ); |
| 662 | + } |
| 663 | + |
| 664 | + // Dereference the script |
| 665 | + script = undefined; |
| 666 | + } catch ( e ) { } |
663 | 667 | } |
664 | 668 | }; |
665 | 669 | } |