Wikipedia:WikiProject User scripts/Guide/Ajax: Difference between revisions

Content deleted Content added
Line 33:
;Using module <code>mediawiki.api</code> (make sure to add this to your dependencies!)
<source lang="javascript">
function ok( wikitext ) {
/* .. */
alert( 'The wikitext of the page is:\n\n' + wikitext );
Line 67:
mw.util.wikiScript('api'),
'format=json&action=query&prop=revisions&rvprop=content&rvlimit=1&titles=Wikipedia:Sandbox',
function ( data ) {
var page, wikitext;
try {