W3C home > Mailing lists > Public > www-validator@w3.org > September 2011

Validator error messages

From: msanderz <msanderz@att.net>
Date: Mon, 19 Sep 2011 15:14:03 -0800
Message-ID: <000a01cc7721$d2c20ae0$4101a8c0@Pantry>
To: "Me" <msanderz@att.net>, <www-validator@w3.org>
Validator team:

I will try to be brief yet informative.

subject:      Error messaged during validation
messages: document type does not allow element "p" here

The validator fails to recognize DOM objects in this case:
HTML code:
   var linkNew = new splash("splash_new", "images/splash_new.gif", 
     "openPage('whatsnew.html')", 
    "<p>What is new?</p>", "whatsnew.html" );

The error message refers to the  "<p>What is new?</p>",  portion of the above code snippet.
When I replaced the above code snippet left and right arrows with "&lt;" and "&lt;", as in:

   var linkNew = new splash("splash_new", "images/splash_new.gif", 
   "openPage('whatsnew.html')", 
   "&lt;p&gt;What is new?&lt;/p&gt;", "whatsnew.html" );

the code displays the text "<p>What is new?</p>" rather than treating it like a paragraph. It does however pass the validation.

The above code is used to create a navigational object. The items within the parenthesis are elements of the object. The object is created using the below constructor template.

    function splash(cell,image,clk,meta,path) // constructor
     {
     this.cell  = cell;         // div-id cell for menu
     this.image = image;  // splash thumbnail image
     this.clck  = clk;         // onclick function
     this.meta = meta;     // meta data
     this.path = path;      // path to site
     this.page = splashPage;  // method for page
     this.site  = splashSite;  // method for site
     }

So I can either have the validator pass the code and fail to properly display
OR
I can have the code work but not be valid, according to the validator.

Thank you for any light you may shed on this subject.

Mathew Sanders
msanderz@att.net
Received on Tuesday, 20 September 2011 05:53:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:48 GMT