User:JJPMaster/Scripts/GreenAndGold.js: Difference between revisions

Content deleted Content added
no more arrow functions
No edit summary
Line 2:
const wikiSlash = mw.config.get("wgArticlePath").replace("$1", '');
const links = $(`a[href*='${wikiSlash}']`);
let titles = [];
let finalTitle;
(new mw.Api()).get( {
action: 'query',
prop: 'categories',
titles: finalTitle
}).done(function(data) { console.log(data)});
 
$(links).each(function() {
alerttitles.push($(this).attr("href").replace(wikiSlash, ''));
finalTitle = titles.join("|");
});
});