www.webdeveloper.com
Results 1 to 4 of 4

Thread: W3 validation errors

  1. #1
    Join Date
    Feb 2008
    Posts
    36

    W3 validation errors

    Hello,

    I have a page (XHTML 1.0 transitional) that is working fine but generates some validation errors and warnings I don't find how to solve. They are JS related.
    This is a warning. The error will be posted into another thread
    Line 35, Column 14: character "&" is the first character of a delimiter but occurred as data
    if (anchor && anchor=='#presup'){ ....


    HTML Code:
    <script type="text/javascript" language="javascript">
    var anchor=self.document.location.hash; 
    if (anchor && anchor=='#presup'){ 
    	  window.onload=function() {
    		  fireOnclick('comp'); // pass the ID
    	  }
      }					 
    </script>
    How can I fix this?
    Thanks in advance

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Feb 2008
    Posts
    36

    W3 validation error and JS

    I have a page (XHTML 1.0 transitional) that is working fine but generates a validation error don't find how to solve.
    This is located at <HEAD> section
    HTML Code:
    <script type="text/javascript" language="javascript"> 
    var bocet = '<? include('bocet_data.php'); ?>';		 
    </script>
    This var contains one line html script that is displayed within a pop-up created using overlib package. It starts '<p><strong>ESTE DOCUMENTO ES UN ACUE...'.
    In the <BODY> section there is a link:
    HTML Code:
    <a href="javascript:void(0);" onclick="return overlib(bocet, WIDTH, 600, ...(supressed extra settings);" >BOCETOS</a>
    W3 validator displays
    var bocet = '<p><strong>ESTE DOCUMENTO ES UN ACUERDO LEGAL ENTRE USTED (&ldquo

    The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

    One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

    I need a help on how to validate it.
    thank you

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Same as post #2 and escape slash in tags
    At least 98% of internet users' DNA is identical to that of chimpanzees

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles