Issue Details (XML | Word | Printable)

Key: VALIDATOR-210
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Niall Pemberton
Reporter: Neil Sherman
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Validator

Generated JavaScript Causes HTML Page to Contain Illegal HTML

Created: 23/Nov/06 09:04 AM   Updated: 12/Nov/07 07:25 PM
Return to search
Component/s: JavaScript
Affects Version/s: 1.3.0 Release
Fix Version/s: 1.3.1 Release

Time Tracking:
Not Specified

Environment: All

Resolution Date: 23/Nov/06 09:25 AM


 Description  « Hide
Various JavaScript functions contain JavaDoc comments at the start such as:

/*$RCSfile: validateMaxLength.js,v $ $Rev: 376673 $ $Date: 2006-02-10 13:42:31 +0000 (Fri, 10 Feb 2006) $ */
/**

  • A field is considered valid if less than the specified maximum.
  • Fields are not checked if they are disabled.
  • <p>
  • <strong>Caution:</strong> Using <code>validateMaxLength</code> on a password field in a
  • login page gives unnecessary information away to hackers. While it only slightly
  • weakens security, we suggest using it only when modifying a password.</p>
  • @param form The form validation is taking place on.
    */
    function validateMaxLength(form) {

This causes the W3C tidy application to report the following:

"<" + "/" + letter not allowed here
Cause:

The 2 characters "</" have been detected in a wrong place.
Solution:

In most case, this is due to wrong javascript:

BAD <document.write("</h1>");
GOOD <document.write("<\/h1>");

References:

W3C faq: http://validator.w3.org/docs/help.html#faq-javascript
HtmlHelp: http://www.htmlhelp.com/tools/validator/problems.html#script

And thus produces illegal HTML.

The proposed solution is to remove the offending tags.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.