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

Content deleted Content added
corrections
No edit summary
Line 19:
},
error: function() {
alert( 'The queryajax returnedrequest an errorfailed.' );
}
});
Line 40:
},
success: function( data ) {
if ( 'error' in data ) {
var token = data.query.pages[ data.query.pageids[0] ].edittoken;
alert( 'API Error ' + data.error.code + '. ' + data.error.info );
doEditPage( token );
} else if ( data.query && data.query.pages && data.query.pageids ) {
var token = data.query.pages[ data.query.pageids[0] ].edittoken;
doEditPage( token );
} else {
alert( 'The token query returned an unknown error.' );
}
},
error: function() {
alert( 'The tokenajax queryrequest returned an errorfailed. =(' );
}
});