Solved! Go to Solution.
...and your app is definitely referencing the API the same way?
Just humour me, put this in your application page before the script element used to load the API:<script type="text/javascript"> var dojoConfig = { baseUrl:"http://localhost/arcgis_js_api/library/3.1/jsapi/js/dojo/dojo/" }; </script>
You're welcome...but it's not the complete answer. (and I was delaying posting it in the hope of finding the real cause - tricky to do remotely though!)
The 'official' method should work although I think this way's better for most people and it's much simpler to explain!
With the current value i.e.localhost, it will only work when the app is being accessed from the same machine on which the API resides so you either need to change the value "localhost" to be either the IP or the hostname used to access the website or if all the apps are on the same site as the API you could use a relative URL.
I urge you to investigate and gain a full understanding of how URLs and paths are used in Dojo and don't accept a quick answer just because it works.
Please ask if you have any further questions.
(something is not right with the way that the baseUrl is being calculated in your apps, you really should find out why)
I identify the problem. I search baseUrl in my webapp and found this code:
djConfig = {
parseOnLoad:true,
baseUrl: "./",
isDebug:false,
locale: "it",
modulePaths: { "dijits": "./dijits" }
};
I search dojo.config and not djConfig for this i don't found. I have commented the part of baseUrl and the webapp run correctly.
Thanks so much 😄
This is the correct answer 😄
Please show us the path you have used to the JS API and also what you've got in your dojoConfig etc.
The base URL being used to retrieve resources is incorrect, we just need to work out why.
...and exactly what have you set in your dojoConfig?
Ah, so I was correct earlier:
Please mark whichever post you think is correct as the 'answer'.
Told you it was worth investigating the 'real' cause, much more satisfying than simply pasting someone else's code, don't you agree? 🙂