SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot Fruit & Veg's Avatar
    Join Date
    May 2000
    Location
    UK
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XHTML and the <noscript> tag

    OK, ran my page through the w3 validator and it's saying the <noscript> in my <head> section (for webtrends) is invalid. How can I get around that?

    Also, I have a 'back' button which has some JS in and the validator is saying the onMouseOver and onMouseOut is invalid - but I also have a 'forward' button with basically the same code, but it doesn't mention that. Anyway around that?

    Here's the page - http://www.shiola.co.uk/test.shtml
    USBtastic - UK Gadgets Blog
    SmartGeezer - UK Men's Clothing Blog
    Individualitee - Great Tshirts
    Shiola - Complete Waste of Time

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I don't think the noscript and image belongs in the HEAD of the page, but rather in the BODY. That might be the problem.

  3. #3
    SitePoint Addict naveed's Avatar
    Join Date
    Feb 2003
    Location
    Ottawa, Canada
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    According to the XHTML Strict DTD, only the following tags can be included in the header:

    <script>
    <style>
    <meta>
    <link>
    <object>

  4. #4
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yet the WAI says at: http://www.w3.org/TR/WCAG10/#gl-new-technologies

    6.3 Ensure that pages are usable when scripts, applets, or other programmatic objects are turned off or not supported. If this is not possible, provide equivalent information on an alternative accessible page. [Priority 1]
    For example, ensure that links that trigger scripts work when scripts are turned off or not supported (e.g., do not use "javascript:" as the link target). If it is not possible to make the page usable without scripts, provide a text equivalent with the NOSCRIPT element, or use a server-side script instead of a client-side script, or provide an alternative accessible page as per checkpoint 11.4. Refer also to guideline 1.
    Which seems to place us with a small dilemma if you use Javascript that contains content rather than control. If you rely on Javascript to server content then you will be in trouble, so making sure that content is outside the script is one of the solutions.
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.

  5. #5
    Word Painter silver trophy Shyflower's Avatar
    Join Date
    Oct 2003
    Location
    Winona, MN USA
    Posts
    10,053
    Mentioned
    142 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by John Colby
    Yet the WAI says at: http://www.w3.org/TR/WCAG10/#gl-new-technologies



    Which seems to place us with a small dilemma if you use Javascript that contains content rather than control. If you rely on Javascript to server content then you will be in trouble, so making sure that content is outside the script is one of the solutions.
    I place my javascripts inside this comment :

    Code:
    <script language="javascript" type="text/javascript">
    //<![CDATA[
    this is the end tag:
    Code:
    //]]>
    </script>
    I use site meter for stats and they also have a no-script tag in the javascript, but their entire script goes in the body of the html.
    Linda Jenkinson
    "Say what you mean. Mean what you say. But don't say it mean." ~Unknown

  6. #6
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Fruit & Veg
    Also, I have a 'back' button which has some JS in and the validator is saying the onMouseOver and onMouseOut is invalid - but I also have a 'forward' button with basically the same code, but it doesn't mention that. Anyway around that?
    XHTML is case-sensitive. onmouseover isn't the same thing as onMouseOver; change your attributes to all lowercase and you should validate again.

  7. #7
    SitePoint Zealot Fruit & Veg's Avatar
    Join Date
    May 2000
    Location
    UK
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vgarcia - on the money, cheers.

    I stuck the <noscript> code into the <body> and the number of errors went down, but it still tries to validate the actual code in the img tag. This one line produces 20 errors - so close yet so far!!

    Can I hide this code from the validator yet it still owrks for non-JS browsers, or shall I just dump this code as it's spoiling my beautiful code and who cares about non-JS browsers anyway?

    I'm leaning towards the later, screw those facists.
    USBtastic - UK Gadgets Blog
    SmartGeezer - UK Men's Clothing Blog
    Individualitee - Great Tshirts
    Shiola - Complete Waste of Time

  8. #8
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Look again at http://www.w3.org/TR/WCAG10/#gl-new-technologies
    . . . 6.3 Ensure that pages are usable when scripts, applets, or other programmatic objects are turned off or not supported . . . . provide a text equivalent with the NOSCRIPT element . . .
    It doesn't say you HAVE to use noscript - as long as your page is accessible anyway. I think the question you should ask yourself is "Why is the <noscript> there anyway?"

    A discussion is here - http://lists.w3.org/Archives/Public/...nMar/0082.html
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.

  9. #9
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,322
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Fruit & Veg, what's your latest attempt?

    validating a simple image tag, even if it's inside a NOSCRIPT, is rather easy

    i'd be happy to help you validate yours

    perhaps it's the ampersands in your SRC href

    you have to escape those

    <img border="0" width="1" height="1"
    src=" ... /button5.asp?tagver=5&amp;si=148737&amp;fw=1&amp;js=No&amp;" />
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •