//wait for mw.util mw.loader.using( 'mediawiki.util', function () { $(function() { console.log( '$content is ' + (mw.util.$content === null ? '' : 'not ') + 'null in jQuery.ready'); }); //mw.util.callback is provided by the patch if (!mw.util.callback) { return; } mw.util.callback.add(function() { console.log( '$content is ' + (mw.util.$content === null ? '' : 'not ') + 'null in mw.util.callback'); }); });