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

Content deleted Content added
Fetch page content: Use promises!
Line 19:
<source lang="javascript">
$.ajax({
url: mw.util.wikiGetlink( 'Wikipedia:Sandbox' ),
})
success: function( data ) {
.done(function( data ) {
alert( 'The remote page contains:\n' + data );
},)
error: .fail(function() {
alert( 'The ajax request failed.' );
}
});
</source>