MediaWiki:Client-side-ResourceLoader/code.js

window.dev.ResourceLoader = function { this.getScript = function(page, success, err) { var req = { url: mw.util.wikiScript('api'), data: { action: 'query', prop: 'revisions', rvprop: 'content', titles: page, format: 'json', indexpageids: true },           dataType: 'script', dataFilter: function(rawData, type) { var res = JSON.parse(rawData); return res.query.pages[res.query.pageids[0]].revisions[0]['*']; },           success: success }

if (arguments.length === 3 && typeof err == 'function') { req.error = err; }

return $.ajax(req); }

return this; }