AnsweredAssumed Answered

Version 3.0 sample issues

Question asked by krdyke on Jun 28, 2012
Latest reply on Jun 28, 2012 by krdyke
Hi all,

I've been getting encountering issues working with samples for version 3.0. First of all, I've just started working with the API recently, so am not sure what needs to be changed with the move to Dojo 1.7 in v3.0. Using this sample as an example, after copying the code and saving it locally, I can view it in IE9, but neither Chrome or Firefox allow it. Chrome gives an error "Request header field X-Requested-With is not allowed by Access-Control-Allow-Headers", while Firefox spits out an error message of "Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: :: <TOP_LEVEL> :: line 15" data: no]"

However, when designating the URL of the API in the head of my HTML, if instead of this:

I use this:

It then loads okay in all browsers, but still gives the errors, and intermittently does not work. The result being, I'm quite confused. 

I'm currently without an instance of Server, so hosting the API locally isn't an option at this point. Any advice as to what's happening, where I've gone wrong, etc. would be greatly appreciated. Here's the HTML I've been referencing. Hopefully I'm just making a bonehead mistake!

  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
  <!--<script src="" type="text/javascript"></script>-->
  <script src="" type="text/javascript"></script>
  <link href="" rel="stylesheet" type="text/css" >
  <link rel="stylesheet" type="text/css" href="">
  <script type="text/javascript">
  <script type="text/javascript">
    function init() {
      map = new esri.Map("mapDiv");
    var basemapURL= ""
      var basemap = new esri.layers.ArcGISTiledMapServiceLayer(basemapURL);
<body class="claro">
  <div id="mapDiv" style="width:900px; height:600px; border:1px solid #000;"></div>