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", 
    "<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", 
   "&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
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
Received on Tuesday, 20 September 2011 05:53:42 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:59:23 UTC