MediaWiki:SimilarArticles/code.js

$.getJSON(wgScriptPath + '/api.php?' + $.param({ action: 'opensearch', search: wgPageName, format: 'json' })).then(function(res) {   // First result is page itself	if (res[1].length) {		res[0] = res[1].shift;    }    // Test if no results again because it could have been diminished by one	if (res[1].length) {        $('.js-similar-articles').empty;        ul = $(' ').appendTo('.js-similar-articles');        res[1].forEach(function(article) { $(' ').appendTo(ul).append(               $('', { text: article, href: wgScriptPath + '/wiki/' + article })            ); });   } });