Can't load map for the sample code

644
3
05-17-2014 09:59 AM
JisikiYeah
New Contributor
HI, 

I am a starter, 
When I download the samplecode from http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=map_webmap

Which is a simple code for loading the arcgis map with     <div id="mapDiv"></div>
    <div id="legendDiv"></div>

But , when I download the code and run it on my browser,  the map can't be loaded, there is blank in my chrome and IE,
0 Kudos
3 Replies
BenFousek
Occasional Contributor III
Welcome to the forum.

Just a guess, but are you loading the the file from a file or via a web server? It won't work if you are loading it from a file, i.e. file:///C:/sample/index.html. If so, you need to use a local web server, use an IDE with one built in, use a real web server, etc. Then load the file via http://localhost/sample/index.html for example.
0 Kudos
JisikiYeah
New Contributor
Welcome to the forum.

Just a guess, but are you loading the the file from a file or via a web server? It won't work if you are loading it from a file, i.e. file:///C:/sample/index.html. If so, you need to use a local web server, use an IDE with one built in, use a real web server, etc. Then load the file via http://localhost/sample/index.html for example.


Thanks,  after loading to the tomcat,   it works. .
0 Kudos
BenFousek
Occasional Contributor III
Glad to help. Please mark this post as answered so others know your issue is resolved. Thanks.
0 Kudos