MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1,056: Line 1,056:
         $.getJSON(apiUrl, {
         $.getJSON(apiUrl, {
             action: 'parse',
             action: 'parse',
             page: pageTitle,         // e.g. "090"
             page: pageTitle,     // e.g. "091"
             prop: 'text',
             prop: 'text',
             format: 'json',
             format: 'json',
             formatversion: 2         // html at res.parse.text
             formatversion: 2
            // origin not needed same-origin
         }).done(function (res) {
         }).done(function (res) {
             if (!res || !res.parse || !res.parse.text) {
             if (!res || !res.parse || !res.parse.text) {
Line 1,086: Line 1,085:


             var doc = iframe.contentDocument || iframe.contentWindow.document;
             var doc = iframe.contentDocument || iframe.contentWindow.document;
             var printCssUrl = mw.util.getUrl('MediaWiki:Print.css', { action: 'raw', ctype: 'text/css' });
 
            // Print CSS URL (raw)
             var printCssUrl = (mw.config.get('wgScriptPath') || '') +
            '/index.php?title=MediaWiki:Print.css&action=raw&ctype=text/css';


             doc.open();
             doc.open();
Line 1,110: Line 1,112:
         });
         });
     });
     });




Navigation menu