AnsweredAssumed Answered

Hosting ArcGIS JS API in local environment

Question asked by bforbhavin on Nov 7, 2014

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?

Outcomes