missing } after property list

2313
3
05-19-2010 03:53 AM
JensOldeland
New Contributor
Hi again,

Firebug gives me an Error I simply cannot tackle. I tried two days already but I did not find the error. Furthermore it tells me that my init-function (LoadMap) cannot be found. why? it is definitely there!

I would be grateful if anyone could check my code:

http://biota.botanik.uni-hamburg.de:8399/web/Test-Error/Observatory_WebGIS_PartII.html

thank !you
0 Kudos
3 Replies
DerekSwingley
Occasional Contributor
First thing:  are you trying to use the ArcGIS API for JavaScript or the ArcGIS JavaScript Extension for the Google Maps API? Your html references the former, but your code looks like it's written for the latter.

Also, you should pick one of the following, not both to run LoadMap:
dojo.addOnLoad(LoadMap)
<body class="tundra" onload="LoadMap();" onunload="GUnload();">


Finally, and this is probably the cause of the error you're posting, change this:
content:"<div style='width:275px; height:175px;'><b>Total 2007 Census Block Population is " + att.S2001 + ".</b><br />The age breakdown is as follows. <br />"
    + "<img height=100 width=250 src='http://chart.apis.google.com/chart?cht=bvs&amp;chs=250x100&amp;chd=t:"
    + S2001 "," + S2002 + "," + S2003 + ","  + S2004 + "&amp;/></div>"};


To this:
content:"<div style='width:275px; height:175px;'><b>Total 2007 Census Block Population is " + att.S2001 + ".</b><br />The age breakdown is as follows. <br />" + 
    "<img height=100 width=250 src='http://chart.apis.google.com/chart?cht=bvs&amp;chs=250x100&amp;chd=t:" + 
    S2001 "," + S2002 + "," + S2003 + ","  + S2004 + "&amp;/></div>"};


Notice the + at the end of the line rather than at the beginning of a new line.
0 Kudos
JensOldeland
New Contributor
Derek !

you saved my evening! Many thanks!
Now it works! The mistake was in not having the plus-sign after the "t:". But this is strange because I tried it in so many ways and it never worked...

I also found another missing "+" after  "+ 2001".

many thanks also for the hint on the LoadMap() thing. I included the dojoAddonload simply because one error was "LoadMap was not loaded" so I tried again many many possibilities.

THX
0 Kudos
DerekSwingley
Occasional Contributor
Glad to help!
0 Kudos