Jump to content

User:DerHexer/monobook.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by DerHexer (talk | contribs) at 13:39, 25 November 2013 (test). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
$.ajax({
        // request type ( GET or POST )
        type: "GET",
 
        // the URL to which the request is sent
        url: mw.util.wikiScript('api'),
 
        // data to be sent to the server
        data: { action:'query', format:'json', prop: 'info', intoken: 'delete', titles: 'Madrid' },
 
        // The type of data that you're expecting back from the server
        dataType: 'json',
 
        // Function to be called if the request succeeds
        success: function( jsondata ){
               alert( jsondata.result );
               // thistoken=data.responseXML.getElementsByTagName('page')[0].getAttribute('deletetoken');
        }
});
/*
alert(thistoken);

$.ajax({
        // request type ( GET or POST )
        type: "POST",
 
        // the URL to which the request is sent
        url: mw.util.wikiScript('api'),
 
        // data to be sent to the server
        data: { action:'undelete', title: 'Madrid', reason: 'Restored.', token: encodeURIComponent(thistoken) },
 
        // The type of data that you're expecting back from the server
        dataType: 'json',
 
        // Function to be called if the request succeeds
        success: function( jsondata ){
                alert( jsondata.result );
        }
});
*/