glenreid

ESRI Reference Error

Discussion created by glenreid on Mar 15, 2013
Latest reply on Mar 15, 2013 by JGravois-esristaff
I have an older map application that is using version 2.8 of the API and it runs fine.  I updated the API and CSS references to version 3.3 and added the necessary ESRI CSS:

I now get the following 2 errors in FireBug:

ReferenceError: esri is not defined
var regionsGraphicsLayer = new esri.layers.GraphicsLayer();

ReferenceError: esri is not defined
gpAccumulation = new esri.tasks.Geoprocessor("http://gis.stage.ncdc.noaa.gov/arcgis/rest/services/gp/dailysnow2/GPServer/accumulation");

These errors are in external JS files (resis.js and dailyAccumulation.js).

Here is the JS code referencing those files in my JSP page:

 <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/dojo/dijit/themes/claro/claro.css">  
        <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/dojo/dojox/grid/resources/Grid.css">
        <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/dojo/dojox/grid/resources/claroGrid.css">
 <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/esri/css/esri.css" />
 <link rel="stylesheet" type="text/css" href="css/snowfall.css">

    <script type="text/javascript">var djConfig = {parseOnLoad: true};</script>
 <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.3"></script>
 <script type="text/javascript">
  dojo.require("dijit.dijit");
  dojo.require("dijit.Dialog");
  dojo.require("dijit.form.Button");
  dojo.require("dijit.form.CheckBox");
  dojo.require("dijit.form.DateTextBox");
  dojo.require("dijit.form.TextBox");
  dojo.require("dijit.form.ValidationTextBox");
  dojo.require("dijit.layout.BorderContainer");
  dojo.require("dijit.layout.ContentPane");
  dojo.require("dijit.layout.TabContainer");
  dojo.require("dijit.TitlePane");
  dojo.require("dijit.Toolbar");
  dojo.require("dojo.data.ItemFileReadStore");
  dojo.require("dojo.fx");
  dojo.require("dojox.grid.DataGrid");
  dojo.require("esri.arcgis.utils");
  dojo.require("esri.dijit.BasemapGallery");
  dojo.require("esri.map");
  dojo.require("esri.tasks.gp");
  dojo.require("esri.tasks.locator");
  dojo.require("esri.tasks.query");
  dojo.require("esri.toolbars.navigation");
  dojo.require("esri.layers.graphics");
 </script>
 <script type="text/javascript" src="js/snowfall/init.js"></script>
 <script type="text/javascript" src="js/snowfall/locator.js"></script>
 <script type="text/javascript" src="js/snowfall/query.js"></script>
 <script type="text/javascript" src="js/snowfall/daily.js"></script>
 <script type="text/javascript" src="js/snowfall/dailyAccumulation.js"></script>
 <script type="text/javascript" src="js/snowfall/monthly.js"></script>
 <script type="text/javascript" src="js/snowfall/resis.js"></script>
 <script type="text/javascript" src="js/snowfall/dateValidation.js"></script>
.
.
.


Any ideas?

Thanks,
Glen

Outcomes