3

I started creating a Dijit based on a template HTML file. I started by referencing Dojo CSS and JS directly, and all was fine.

Later when I wanted to add a map into my dijit, first - changing nothing else - I switched my Dojo CSS links from googleapis.com to js.arcgis.com - and all was still fine.

But then I changed the Dojo JS script reference from googleapis.com to the ArcGIS API for Javascript. Doing this causes an error.

All else staying the same, this worked fine:

 <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js"></script>
 <script>
 require([
 "dojo/parser",
 "dijit/layout/BorderContainer",
 "dijit/layout/TabContainer",
 "dijit/layout/ContentPane",
 "dojox/layout/ExpandoPane",
 "dojo/domReady!"],
 function (parser) {
 parser.parse();
 });
 </script>

But simply changing out that first script tag with:

 <script src="http://js.arcgis.com/3.8/"></script>

I get: dojo/parser::parse() error TypeError: Unable to get property 'toString' of undefined or null reference when I run the page.

I can provide more detail, but I don't want to put you to sleep. Thanks!

Update: upon further toying, I see this doesn't happen every time the app starts. It happens ~3 starts out of 10 on one of my dev workstations, but every start on my other one. The first is IE10 with fast internet, the second is IE11 with moderate, whatever that's worth.

Chrome gives a little more info:

enter image description here

asked Feb 16, 2014 at 23:22

2 Answers 2

8

Can't have lang="en" attribute on the opening HTML tag of the page. Found that gem way down a long ESRI forum post (reply #8) that I'd been too impatient to read before.

answered Feb 22, 2014 at 19:01
2

your script tag is not well closed

<script src="http://js.arcgis.com/3.8/" > </script>
answered Feb 20, 2014 at 16:03
1
  • good eye. typo in question only (corrected), not actual app. issue persists, but now I know that it happens only ~3 app starts out of 10 on one of my dev workstations (IE10), but every start on my other one (IE11). Commented Feb 22, 2014 at 15:57

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.