Index: trunk/phase3/resources/mediawiki/mediawiki.js |
— | — | @@ -631,11 +631,20 @@ |
632 | 632 | } |
633 | 633 | }; |
634 | 634 | } |
635 | | - // IE-safe way of getting the <head> . document.documentElement.head doesn't |
636 | | - // work in scripts that run in the <head> |
637 | | - head = document.getElementsByTagName( 'head' )[0]; |
638 | | - // Append to the <body> if available, to the <head> otherwise |
639 | | - (document.body || head).appendChild( script ); |
| 635 | + |
| 636 | + if ( window.opera ) { |
| 637 | + // Appending to the <head> blocks rendering completely in Opera, |
| 638 | + // so append to the <body> after document ready. This means the |
| 639 | + // scripts only start loading after the document has been rendered, |
| 640 | + // but so be it. Opera users don't deserve faster web pages if their |
| 641 | + // browser makes it impossible |
| 642 | + $( function() { document.body.appendChild( script ); } ); |
| 643 | + } else { |
| 644 | + // IE-safe way of getting the <head> . document.documentElement.head doesn't |
| 645 | + // work in scripts that run in the <head> |
| 646 | + head = document.getElementsByTagName( 'head' )[0]; |
| 647 | + ( document.body || head ).appendChild( script ); |
| 648 | + } |
640 | 649 | } else { |
641 | 650 | document.write( mw.html.element( |
642 | 651 | 'script', { 'type': 'text/javascript', 'src': src }, '' |