Results 1 to 5 of 5

Thread: Email riddler invalid HTML transitional?

  1. #1
    Join Date
    Feb 2005
    Posts
    71
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Email riddler invalid HTML transitional?

    I use the email riddler from dynamic drive to encrypt email addresses on websites but now I've found from the W3C markup validity service (http://validator.w3.org) that the code makes my page http://www.vweekender.co.uk/contact.htm not not Valid HTML 4.01 Transitional. See: http://validator.w3.org/check?uri=ht...doctype=Inline

    How can I correct this?

    Rob

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Escape the slash in the </a> with a backslash:
    Code:
    <\/a>
    However, a) this script is horrible, and stops people without Javascript-enabled browsers from sending you emails, and b) the transitional period has been over for a long time, and you should be using HTML 4.01 Strict:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  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

    Here's a tool that does about the same thing but, will allow folks without javascript enabled to email you:

    http://home.comcast.net/~ansiguy/emailen1.htm

    Unfortunately, I have yet to find a method of encrypting email addresses that works with anything other than the maito: href which, has its problems. It requires that the user have a properly configured email client and many folks don't.

    Oh, and Twey, transitional is still the DOCTYPE of choice here and many other places, regardless of what you or anyone else might prefer to be the case.

    To Both:

    Escaping a / in a closing HTML tag in a string in a javascript is really somewhat silly and makes no difference to anything whatsoever except the W3c validator - perhaps other validators too. It isn't invalid HTML, it isn't even HTML. Not doing it will get you into trouble with the script interpreter in a few specific instances but, obviously this is not one of those.

    That said, I often escape them just to shut up the damn (can I say damn?) validator.
    Last edited by jscheuer1; 01-14-2007 at 10:39 PM.
    - John
    ________________________

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

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Unfortunately, I have yet to find a method of encrypting email addresses that works with anything other than the maito: href which, has its problems. It requires that the user have a properly configured email client and many folks don't.
    Thus, a server-processed form is really the best option.
    Oh, and Twey, transitional is still the DOCTYPE of choice here and many other places, regardless of what you or anyone else might prefer to be the case.
    But there's no reason this should be the case. It's not really a DOCTYPE of choice, more the DOCTYPE selected by default by someone who doesn't know better. Occasionally people do use it in order to use, say, frames, but this is generally a sign of a poor design (or a magpie-like fixation on what's perceived to be smoother) rather than any real need to use frames.
    Escaping a / in a closing HTML tag in a string in a javascript is really somewhat silly and makes no difference to anything whatsoever except the W3c validator - perhaps other validators too. It isn't invalid HTML, it isn't even HTML. Not doing it will get you into trouble with the script interpreter in a few specific instances but, obviously this is not one of those.
    Yes, putting the script is an external file is the preferable solution, and I do this on all new pages. However, there's really no serious problem with tags inside script elements, since, if I recall correctly, the contents of a script tag is defined as CDATA, so the tags (other than </script>) shouldn't have any special meaning, and I do it with existing pages occasionally just, as you say, to shut the validator up. I must wonder exactly why it is that the validator throws an error here though.
    Last edited by Twey; 01-14-2007 at 10:54 PM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Feb 2005
    Posts
    71
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Thanks to both of you for your replies.

    Rob

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
  •