MediaWiki:Common.js

Revision as of 00:32, 17 November 2015 by Vid (Talk | contribs)

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Clear the cache in Tools → Preferences
/* Any JavaScript here will be loaded for all users on every page load. */


console.log(getParameterByName('Scenario_Task_Translation[Base+Page]'));

  var query = 'http://mywiki/mw/api.php?action=ask&query=[[2 factor authentication]]|?Scenario Task Description&format=json';
  $.getJSON(query, function(data) {
    console.log('data', data);
  });

function getParameterByName(name) {
    var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
    return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
Last modified on 17 November 2015, at 00:32