win.importScript = importScript;
win.importStylesheet = importStylesheet;
- // Replace document.write with basic html parsing that appends
+ // Replace document.write/writeln with basic html parsing that appends
// to the <body> to avoid blanking pages. Added JavaScript will not run.
- mw.log.deprecate( document, 'write', function ( html ) {
- $( 'body' ).append( $.parseHTML( html ) );
- }, 'Use jQuery or mw.loader.load instead.' );
+ $.each( [ 'write', 'writeln' ], function ( idx, method ) {
+ mw.log.deprecate( document, method, function ( html ) {
+ $( 'body' ).append( $.parseHTML( html ) );
+ }, 'Use jQuery or mw.loader.load instead.' );
+ } );
}( mediaWiki, jQuery ) );