JSFiddle - React, Tailwind, and code Playground

by spinal007

HTML

This JS goes at the bototm of every page and asynchronously loads jQuery followed by the site's JS combined and minified

JavaScript

window.jsQ = [
        ["$"],
        ["/min/?g=js"]
    ];
    var jsN, jsF;

    function jsG(d, c) {
        var a = !1,
            b = document.createElement("script"),
            e = document.getElementsByTagName("head")[0];
        b.src = d;
        b.onload = b.onreadystatechange = function () {
            a || this.readyState && "loaded" != this.readyState && "complete" != this.readyState || (a = !0, "function" == typeof c && c(), b.onload = b.onreadystatechange = null, e.removeChild(b))
        };
        e.appendChild(b)
    }

    function jsD() {
        if (window.jsQ && window.jsQ.length) {
            jsN = 0;
            for (var d = window.jsQ.shift(), c = 0; c < d.length; c++) {
                var a = d[c];
                switch (a) {
                case "$":
                    a = "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js";
                    break;
                case "$mg":
                    a = "//cdnjs.cloudflare.com/ajax/libs/jquery-migrate/1.2.1/jquery-migrate.min.js";
                    break;
                case "$ui":
                    a = "//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"
                }
                "function" == typeof a ? jsF = a : a && "" != a && (jsN++, jsG(a, function () {
                    jsN--;
                    0 == jsN && ("function" == typeof jsF && (jsF(), jsF = void 0), jsD())
                }))
            }
        }
    }
    window.addEventListener ? window.addEventListener("load", jsD, !1) : window.attachEvent ? window.attachEvent("onload", jsD) : window.onload = jsD;