User:Jens Ingels/common.js

var jqxhr = $.getJSON( "https://global.api.pvp.net/api/lol/static-data/euw/v1.2/item?itemListData=all&api_key=dcca3b65-cb7e-4eb1-b1ac-703091dbd33d", function { console.log( "success" ); }) .done(function {   console.log( "second success" );  }) .fail(function {   console.log( "error" );  }) .always(function {   console.log( "complete" );  }); // Perform other work here ... // Set another completion function for the request above jqxhr.complete(function( data ) { console.log( "second complete" );  var getMyData = data.responseText  console.log( getMyData ); });

/* $.get( "?curid=2623&action=render", function( data ) { $( ".result" ).html( data );  console.log( data );  alert( data ); });

//data.match(/{\[disp_name=\]}(.*){\[\|\]}/)[1];

// RECENT DATA

//function getdata(data, str) { // var myRe = new RegExp(str, 'i'); // return data.match(str)[1] //}

//$.get( "http://leagueoflegends.wikia.com/wiki/Long_Sword?action=raw", function( data ) {  //console.log(getdata(data, "\\|name\s{1,5}=(.*?)\\|" ));   //nameData = data.match(/\|name\s+\=\s(.*?)\|/i); //   nameData = data.match(/\|name\s+=\s.*/i); //   itemData = data.match(/(name|type|effects|menu|buy|sell|code)\s+=\s.*/g); //   effectsData = itemData[1].match(/[^effects\s\=].*/i); //   attackData = effectsData[0].match(/\d+(%|)\s\[\[attack damage\]\]/g); //   attackDataValue = attackData[0].match(/\d+/i); //   console.log(attackDataValue); //});

/* $.get( "http://leagueoflegends.wikia.com/wiki/Template:Data_Lucian?action=raw", function( data ) { $( ".result" ).html( data );  code = /\|range=(.*?)\|/i;  code = /\|title=(.*?)\|/i;  console.log(getdata(data, "\\|range=(.*?)\\|" ));  //name = "range";  //testA = data.match( new RegExp("\\|" + name + "=(.*?)\\|","i") ):  //alert( testA[1] );  msData = data.match(/\|ms=(.*?)\|/i);  rangeData = data.match(/\|range=(.*?)\|/i);  attack_delayData = data.match(/\|attack_delay=(.*?)\|/i);  as_baseData = data.match(/\|as_base=(.*?)\|/i);  dam_baseData = data.match(/\|dam_base=(.*?)\|/i);  arm_baseData = data.match(/\|arm_base=(.*?)\|/i);  mr_baseData = data.match(/\|mr_base=(.*?)\|/i);  hp_baseData = data.match(/\|hp_base=(.*?)\|/i);  mp_baseData = data.match(/\|mp_base=(.*?)\|/i);  hp5_baseData = data.match(/\|hp5_base=(.*?)\|/i);  mp5_baseData = data.match(/\|mp5_base=(.*?)\|/i);  as_lvlData = data.match(/\|as_lvl=(.*?)\|/i); dam_lvlData = data.match(/\|dam_lvl=(.*?)\|/i); arm_lvlData = data.match(/\|arm_lvl=(.*?)\|/i); mr_lvlData = data.match(/\|mr_lvl=(.*?)\|/i); hp_lvlData = data.match(/\|hp_lvl=(.*?)\|/i); mp_lvlData = data.match(/\|mp_lvl=(.*?)\|/i); hp5_lvlData = data.match(/\|hp5_lvl=(.*?)\|/i); mp5_lvlData = data.match(/\|mp5_lvl=(.*?)\|/i); });