.Maui Blog

jQuery – Fall back to hosted library if cdn fail

Production applications should not be heavily dependent on CDN activities. Applications should use a fallback resource when the CDN is not available.

<script src="https://cdn.dotmaui.com/libs/jquery/3.4.0/jquery.min.js"></script>
<script>
   window.jQuery || document.write('<script src="/js/jquery.min.js"><\/script>');
</script>
Exit mobile version