Aptana Validation Problem

524
2
12-28-2011 05:06 PM
evanpicard
New Contributor II
I just completed the ESRI course "Building Web Applications Using the ArcGIS API for JavaScript ."
In trying to learn a little more, I wanted to build from some of the examples.  It works fine on my PC (win 7 64 bit home).
When I upload everything to my server (win server 2008 R2 running IIS) I get a bunch of Validation Warnings in Aptana. 

I have the same (as far as I can tell) environment set up on each machine.
Aptana 2.0.5, jsapi code assist 2.6.
Javascript validation is set to "Mozilla JavaScript Validator".

The page display correctly, but I get
unknown attribute "gutters"
unknown attribute "design"
unknown attribute "dojotype"
unknown attribute "region"
at every <div> statement.
from <head>
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6" type="text/javascript"></script>
<link rel="stylesheet" type="text/css"     href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.6/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.6/js/dojo/dojox/grid/resources/grid.css">
<link rel="stylesheet" type="text/css" href="http://trainingcloud.arcgis.com/BAAJ/styles/css/BAAJ_Clean.css">


for example, from <body>
<div id="appContent" dojotype="dijit.layout.BorderContainer" design="headline" gutters="true" style="width:100%; height:90%; margin:0;"> </div>

etc
etc
etc
please dont say to ignore them.  i cant just ignore it.  i makes looking for "real" issues nearly all the samples ive seen work around using <div>'s to build the page.  what is wrong with my server?
I've been harassing the instructor from the course, but I feel bad, I can only bug him so much.
someone please help!
Thanks,
Evan
0 Kudos
2 Replies
by Anonymous User
Not applicable
Evan,

What your finding here are elements and attributes that the Mozilla validator doesn't know anything about.  A great example is the dojotype attribute.  This is specific to dojo, and the validator doesn't have dojo validation built in. 

The way I work around this in Aptana is to put all of my javascript code into individual files in my application folder structure and just reference the file in the HTML.  This way, when I'm looking at the javascript in Aptana, there is just javascript, and I can trust what I see in the validation window.  If I look at the HTML in Aptana, I just pay no attention to anything in the validation window, as there's no javascript there.

I would recommend switching your validator to the jslint validation in Aptana.  I find JSLint to be more complete and offer better warnings.  The fact that you're using any validation at all is kudos to you.  Your apps will run much more reliably and with better performance if you take care of all the little code details.

Jeff
0 Kudos
evanpicard
New Contributor II
Thank you.
I turned off the warnings, everything is working fine.
0 Kudos