Difference between revisions of "MediaWiki:Common.js"

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

Revision as of 00:32, 17 November 2015

/* 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, ' '));
}