SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Not yet perfect mattalexx's Avatar
    Join Date
    Oct 2005
    Location
    Taos, NM, US
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <noscript> screwing up my precious validity

    Here's my code:
    Code:
    <h2>Email Link</h2>
    <p> <script type="text/javascript">
    <!--
    var user = 'mattalexx';
    var domain = 'gmail.com';
    var text = user + '@' + domain;
    document.write('<a href=\"mailto:' + user + '@' + domain + '\">'+text+'</a>');
    -->
    </script>
    <noscript><a href="mailto:mattalexx-AT-gmail-DOT-com">mattalexx-AT-gmail-DOT-com</a></noscript>
    </p>
    W3C is giving me this: 'document type does not allow element "a" here; missing one of "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "pre", "address", "fieldset" start-tag .'

    Can anyone help me? I can't figure it out. Is <noscript> considered a block-level tag or something?
    Matt Alexander
    Alexander Site Design

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    good guess, yes, it is

    try this --
    Code:
    <h2>Email Link</h2>
    <script type="text/javascript">
    <!--
    var user = 'mattalexx';
    var domain = 'gmail.com';
    var text = user + '@' + domain;
    document.write('<p><a href=\"mailto:' + user + '@' + domain + '\">'+text+'</a></p>');
    -->
    </script>
    <noscript><p><a href="mailto:mattalexx-AT-gmail-DOT-com">mattalexx-AT-gmail-DOT-com</a></p></noscript>
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    Not yet perfect mattalexx's Avatar
    Join Date
    Oct 2005
    Location
    Taos, NM, US
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks so much.. Let's see if that works.
    Matt Alexander
    Alexander Site Design

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    <noscript> is a block element so it can only go in places in your code where a block element is valid. You can include a <noscript> inside block elements that allow nesting of block elements (such as <div>) but not in block elements that can only contain inline elements (such as <p>).
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •