Select to view content in your preferred language

Good way to guard against Esri js api CDN being down?

1461
5
10-29-2012 11:40 AM
KevinGooss
Regular Contributor
Anyone know of a good way to defensively code against Esri's host being down for the js api (like today)?
I would rather have my site fail gracefully but don't really know how to handle that.
right now it just hangs and i get firebug errors eventually about dojo is not defined.
0 Kudos
5 Replies
LeeHarding
Occasional Contributor
The api can be hosted locally.

Never had the issue, but yes, today I do...Don't know how to test for their api availability. I have used esri.request to try to get json callback to test and trap for map service availability.
0 Kudos
KevinGooss
Regular Contributor
I seem to recall around the 2.0 days when we wanted to host it locally you had to contact esri and they would send you a dvd and it was an installation process on your server.
That seems like overkill when you consider it is really just a text file is it not?
0 Kudos
BrandonHerrington
Occasional Contributor
0 Kudos
KevinGooss
Regular Contributor
Would still be nice to have a way to code defensively against the api not loading , regardless of where it is being served from. Might be nice to even have it try a backup locale if the initial is not working.
0 Kudos
ReneRubalcava
Esri Frequent Contributor
Someone shared this on twitter the other day when the API went down.
This example uses jQuery, but could be applied to any CDN library that you also want to host locally.
http://stackoverflow.com/questions/1014203/best-way-to-use-googles-hosted-jquery-but-fall-back-to-my...
0 Kudos