<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.0/js/dojo/dijit/themes/claro/claro.css"> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.0"></script>
I'm having a similar problem. Also I am running this from my local file system [ATTACH=CONFIG]15793[/ATTACH]
Please use a local web server. It's not realistic to run web apps from your local file system. There are plenty of free options and most OSes come with a web server built-in.
Hi Derek,Thanks for the clarification. However, I agree with Jeff that this represents a new hurdle for developers (especially those just starting out with the JS API).While it's not realistic to run web apps from a local file system, it IS common to fire up a quick sample to check how one specific thing works, which is surely the point of the samples? This is how we test out new functionality before compiling it into a robust web app for deployment (not just in the ArcGIS Server JS API but in other web mapping APIs, or indeed other JavaScript/HTML libraries).I haven't looked into v3.0 yet so I don't fully understand the change, and why it was necessary. As a developer, all I can see is that the copy/paste/test approach used to work, and now doesn't. Perhaps there could be a blog post/tutorial explaining the changes, and giving some simple instructions for the new requirements of a web server - this could be linked on each sample page.Cheers,Steve
Hi all,I guess the main problem is that this new requirement (to use a web server) isn't documented anywhere. Eg, the Samples homepage still links to a video showing how to download a sample and run it from your local disk. None of the individual samples have been updated to list the requirement for a web server.
The video shows using a local instance of IIS to run the sample. Notice that the html file is placed in the wwwroot directory (default location to serve files using IIS) and when it's loaded in the browser, the sample is accessed using http://, not file://.
If I'm running an app from the IIS root folder and I am still getting the following console error:XMLHttpRequest cannot load http://server.arcgisonline.com/ArcGIS/rest/info?f=json. Origin http://<servername> is not allowed by Access-Control-Allow-Origin.Should I be concerned? What could be causing this?
Please help me. The live samples are working when i view it in the browser, but when i copy the code into notepad and run it as a local copy in the browser. The code is not working, nothing is being displayed.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.