User:Blaster Niceshot/wikia.js

//Script to get table info //See http://community.wikia.com/wiki/Thread:1018387 for more details

var lookupData = {};

function getPageData(page) { var property = ''; $.get('http://clashroyale.wikia.com/index.php?title=' + page).done(function(statData){       $('#unit-statistics-table tbody tr:eq(0) th',statData).each(function(i){ lookupData[page] = {}; property = $(this).clone.children.remove.end.text.trim; if (i > 0) { lookupData[page][property] = [0]; console.log(property); $('#unit-statistics-table tbody tr',statData).each(function(a){                   if (a > 0) {                        lookupData[page][property].push($('td:eq(' + i + ')',$(this)).text);                        console.log(lookupData['Goblins'][property]);                    }                }); }       });    }); }

getPageData('Goblins');