Validator error messages

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 UTC