Results 1 to 6 of 6

Thread: Has the Validator Finally Lost It?

  1. #1
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default Has the Validator Finally Lost It?

    I recently got this result when testing a page with an image map in HTML 5:

    Error Line 24, Column 36: Element area is missing required attribute href.

    <area shape="default" nohref alt="">

    Attributes for element area:
    Global attributes
    alt
    coords
    shape
    href
    target
    ping
    rel
    media
    hreflang
    type

    Error Line 24, Column 36: The nohref attribute on the area element is obsolete. Omitting the href attribute is sufficient.

    <area shape="default" nohref alt="">
    Note, they are both for the exact same spot in the document. One says the href is required, the other says to omit it. If I drop the obsolete nohref attribute and omit href as is suggested, the first error remains.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    lol... you should also have another warning, stating that the HTML5 validator is "experimental" and may be "unreliable." I believe the current status of the html5 spec is that the href is optional; nohref is obsolete.

    out of curiosity, did you get a warning for alt="" ? in html5, attribute values may not be an empty string (the attribute should be omitted if the value is empty).

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It also 'loves' this:

    Code:
    <script type="text/javascript">
    /***********************************************
    * Muti-Use inMotion - (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/
    * Author John Davenport Scheuer - username:jscheuer1
    ***********************************************/
    </script>
    I forget exactly. I'm pretty sure it's the // in http://www. that sets it off for some reason.

    I've also gotten erroneous results from some of the more established DTD's. Usually though these tools are what they purport to be, and quite handy at it.

    I'm coming nearly full circle, knowing the place for the first time. I used to think that whatever the browser allowed was OK. Then some folks around here really got on my case about standards. I'm assuredly better off having learned about them. But I'm beginning to think that just makes it easier to know what might work. The standards certainly are not in all cases a predictor of what does work. And there are as many stand on your head while waving your arms solutions, if not more, when employing standards as there are when one ignores them. The standards took away several perfectly good and simple things that existed before them, while at the same time present some new good and simple things. At the same time unnecessarily complex constructs exist in both standards compliant and quirks mode coding.

    The worst part though is the frequent tension between the two camps.

    Added Later:

    I forgot to answer your question on the empty alt attribute. No, the validator said nothing about it.
    Last edited by jscheuer1; 06-17-2011 at 03:44 AM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    there is a big balance to be struck between standards and the real world [ referring -ironically- to the internet ].

    valid code preempts a lot of potential problems, and I'm very much in favor of it. at the same time, it's not a direct indication of what works, especially considering the fact that no two browsers implement the standards in the same way. Also, if you stick to the standards, you cut yourself out of some neat things that are technically invalid but actually supported by almost everyone.

    Triggering standards mode in browsers is important (especially in IE), but beyond that, you need to code what works. most of the time, it's valid anyway.

    Edit:

    yeah, almost any embedded/inline script or css pretty much guarantees the validator will throw a fit


  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    John, I agree with what you said and I've thought that for a long time: standards are only perfect if you don't really analyze them. That doesn't mean they're useless, but it's complicated.

    I think the problem is that standards are chosen, set, and no one really questions them (at least not effectively) because they are standards. But the problem is that just because they are standard there's no reason they are necessarily any better than any other solution. The only advantage would be if all browsers did exactly the same thing every time, but they don't.

    So the bottom line is that, yes, they're good guidelines, and whenever you deviate you should have a good reason. Validating the code is still a good idea, then you can choose to ignore the problematic warnings.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Dec 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It is good for programmere that while writing codes they should validate fast. There are different ways of validation,if it is not validated at that time then afterwards it will give lots of problems and situation will become complicated.
    Last edited by ddadmin; 01-08-2012 at 02:52 PM.

Bookmarks

Posting Permissions

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