const Loader = { require (scripts, callback) { this.loadCount = 0; this.callback = callback; this.totalRequired = scripts.length; scripts.forEach((src) => { this.writeScript(src) }); }, loaded (evt) { this.loadCount++; if (this.loadCount === this.totalRequired && typeof this.callback == 'function') { this.callback.call(); } }, writeScript (src) { const s = document.createElement('script'); s.src = src; s.addEventListener('load', (e) => { this.loaded(e); }, false); document.querySelector('HEAD').appendChild(s); } }; Loader.require([ '{% static "admin/js/jquery.min.js" %}', '{% static "admin/js/jquery.init.js" %}', ], () => { console.log('ok, loaded jquery from admin'); })