MediaWiki:Gadget-altredirects.js

if (mw.config.get('wgNamespaceNumber') === 0 && mw.config.get('wgArticleId') !== 0) { (function {   var pagename = mw.config.get('wgPageName'), target = '';    switch (mw.config.get('skin')) {        case 'monobook':            target = '#firstHeading'; break;        case 'vector':            target = '#firstHeading'; break;        case 'monaco':            target = '#firstHeading'; break;    }    $(target).after('Alt. redirects: ');   $.getJSON('https://allthetropes.orain.org/w/api.php?action=query&list=backlinks&bltitle=' + pagename + '&blfilterredir=redirects&format=json', function(data) { var redirects = data.query.backlinks, rtext = ''; for (var r in redirects) { if (rtext) { rtext += ', '; } rtext += redirects[r].title; }       $('#jsredirect').append(rtext); }); }); }