Select to view content in your preferred language

dojo and AGS javascript API throwing "Could not load cross-domain resources"

473
1
02-03-2011 06:54 AM
bradeckrose
Deactivated User
How do I enable cross-domain access in Visual Studio 2010 to different resources in a web-mashup built on the  ArcGIS server REST  api,  a Work Management web-service, jQuery and Dojo all at once?

I�??ve put crossdomain.xml and clientaccesspolicy.xml files in inetpub/wwwroot and in the top level of the ASP.Net application.

If I try to host everything at localhost/virtualdirectory,  then all the CSS and Javascript that reference the root �??/�?� do not exist at localhost/, they are at localhost/virtualdirectory/

The arcgisonline server seems to include the Dojo api , so I�??m hesitant to try different Dojo downloads for fear of screwing up ArcGIS Server.

Any ideas?

The web-service is hosted at:  WinXP IIS5 localhost:80
The VS debugging is hosted in WinXP VS2010:  ASP.Net development server localhost:8011
ArcGIS REST API is:   http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.1
jQuery is:   http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
0 Kudos
1 Reply
bradeckrose
Deactivated User
Doh...jo!

I was doing a dojo.require("esri.<no such namespace>");

Dojo has a timeout for loading cross domain resources.  When you try to load something that doesn't exist, it times out.  However, it doesn't tell you which resource it crapped on.

Had to comment out individual requires to find the culprit. For some reason, I thought esri.InfoTemplate was a namespace/library, when it's really just a class.

Brad
0 Kudos