JQuery fallback script

It’s possible that a CDN may become unavailable to your web application, if so you’ll want to fallback to another source for your libraries (JQuery in this example).

    <script type="text/javascript">
        if (typeof jQuery == 'undefined') {
            var e = document.createElement('script');
            e.src = [email protected]("~/Content/js/jQuery/jquery-1.11.1.min.js")';
            e.type = 'text/javascript';
            document.getElementsByTagName("head")[0].appendChild(e);
        }
    </script>

Leave a Reply

Your email address will not be published. Required fields are marked *