Hosting ArcGIS JS API in local environment

640
0
11-07-2014 05:56 AM
BhavinSanghani
Occasional Contributor II

I have a question about ArcGIS JS API installation notes. It says to replace ‘[HOSTNAME_AND_PATH_TO_JSAPI]’ with actual path where JS API is hosted locally. Instead of providing machine name, can we use location.origin with relative path following way? That way, every customer of my product will not require to update init.js/dojo.js as per installation notes.

location.origin.split("//")[1] + "<relative path>/arcgis_js_api/library/3.10/3.10/js/dojo/dojo

I am wondering if location.origin can give wrong path in any case e.g. due to security restrictions or some other reasons. Trying to find, in which scenario this can be failed. Any suggestions?

0 Kudos
0 Replies