ArcGIS Javascript api 3.1 esri undefined error

1332
5
08-14-2012 07:24 AM
KalaivaniNellaiappan
New Contributor
Hi,
I Have been upgrading the javascript api from 1.5 to 3.1 and having problems with symbols...
I am getting an error
"Microsoft Jscript runtime error: 'esri' is undefined
Also getting a 404 on a particular js file in the api library...
when i debugged in IE,
URL http://serverapi.arcgisonline.com/jsapi/arcgis/3.1/js/esri/symbol/Symbol.js
Method   GET
Result 404
Type text/html
Received 184 B
Taken  156 ms
Initiator <script>
Any suggestions on this....
Thanks in advance,
Vani
0 Kudos
5 Replies
__Rich_
Occasional Contributor III
Are you trying to load a locally hosted JS API or the one hosted by ESRI?
0 Kudos
KalaivaniNellaiappan
New Contributor
The one hosted by esri...

Thanks,

Vani
0 Kudos
KellyHutchins
Esri Frequent Contributor
Vani,

Can you post the code you are trying to update to 3.1?
0 Kudos
KalaivaniNellaiappan
New Contributor
Here is the code  that triggers this error

<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.1"></script>


var highlightSymbol = new esri.symbol.SimpleFillSymbol();
  highlightSymbol.setStyle(esri.symbol.SimpleFillSymbol.STYLE_SOLID);
  highlightSymbol.setColor(new dojo.Color([255, 255, 0, 0.25]));
  var highlightOutline = new esri.symbol.SimpleLineSymbol();
  highlightOutline.setWidth(2);
  highlightOutline.setStyle(esri.symbol.SimpleLineSymbol.STYLE_DASH);
  highlightOutline.setColor(new dojo.Color([255, 0, 0, 1]));
  highlightSymbol.setOutline(highlightOutline);
  var highlightMarker = new esri.symbol.SimpleMarkerSymbol();
  highlightMarker.setSize(15);
  highlightMarker.setOutline(highlightOutline);
  highlightMarker.setStyle(esri.symbol.SimpleMarkerSymbol.STYLE_X);

Thanks
0 Kudos
KalaivaniNellaiappan
New Contributor
Thanks Kelly,
Got the answer from John Gravois's reply to the thread " Issues with 3.0 when loading app"...
Actually my code was outisde init...
When i moved it inside init... the issue got resolved...
Thanks,
Vani
0 Kudos