Board Thread:JS Development/@comment-9605025-20191030060753/@comment-33109274-20191206210857

This is a possibility, tho I'm pretty sure there will be better options these days (function {    'use strict';    var maxOutstandingRequests = 2;    var outstandingParses = $('.ParseWikitext').toArray;    var url = '/api.php?action=parse&pst&prop=text&format=json&text=';

function parse(elem) { if (!elem) return;

jQuery.getJSON(url + encodeURIComponent(elem.innerHTML), function (reply) {           if (reply && reply.parse && reply.parse.text && reply.parse.text['*'])                elem.innerHTML = reply.parse.text['*'];            parse(outstandingParses.shift);        }); }

for (var k=0; k<maxOutstandingRequests; k++) parse(outstandingParses.shift);

});