Here's how I solved the problem of needing a fall back for when/if the CDN goes down.
- Download the JS from SDK Downloads | ArcGIS for Developers and follow the setup instructions.
- For the sake of this tutorial, I have placed the 3.16 files at /js/3.16/ on my webserver
- Place these two lines of code in place of the normal js include
<script> window.dojo || document.write('<script src="/js/3.16/init.js">\x3C/script>');</script>
It check to see if dojo has been loaded, which is essentially seeing if the js library has been loaded. If not, it loads the local version.
3 people found this helpful