SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy W3C validation issues...

    Any ideas on this? It's my JavaScripts causing validation problems. The site is at http://your.workcomms.com/ntl/

    Firstly, it doesn't like onResize. Is there a way to "validly" implement an onResize?

    Secondly, it doesn't like the way I use a div to discover the left-hand edge of a table and position another div accordingly. Can someone have a look at this and tell me if it's right?

    Here's the W3C error output:

    Quote Originally Posted by The W3C mum!
    1. Line 91, column 522: there is no attribute "onResize" (explain...).
    ...nt/home-message-over.jpg')" onResize="window.location.href('default.asp');">
    ^
    2. Line 186, column 98: an attribute value literal can occur in an attribute specification list only after a VI delimiter
    ...le="left:' + (getAbsoluteLeft("marker") + 540) + 'px; top:' + (getAbsoluteTop
    ^
    3. Line 186, column 98: document type does not allow element "div" here (explain...).
    ...le="left:' + (getAbsoluteLeft("marker") + 540) + 'px; top:' + (getAbsoluteTop
    Enlightenment sought and gratefully received! Thanks guys.

    G

  2. #2
    SitePoint Wizard silver trophy rushiku's Avatar
    Join Date
    Dec 2003
    Location
    A van down by the river
    Posts
    2,056
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    as you're validating XHTML, it helps to remember that attributes should be lower case.

    As for the rest, you might try 'hiding' the 'errors' from the XHTML validator.
    Last edited by rushiku; Dec 19, 2003 at 13:10.

  3. #3
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. Hiding the the other code from the validator worked, but it still isn't happy with onresize, even lower case. It claims onresize is not a valid attribute??

    G

  4. #4
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Suggestions...

    1) put all your js in a separate file.

    2) don't put onresize="..." in the body tag (i don't put onload there either but that's a personal choice). In the separate js file put...
    Code:
    window.onload = function()
    {
      MM_preloadImages(...);
    }
    
    window.onresize = function()
    {
      window.location.href('default.asp');
    }

  5. #5
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahhhh... fantastic! Thanks again Mike!!

  6. #6
    SitePoint Wizard silver trophy rushiku's Avatar
    Join Date
    Dec 2003
    Location
    A van down by the river
    Posts
    2,056
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Sorry Greg, my bad.

    A quick review of an XHTML reference reveals that onresize is no longer a valid attribute for the body tag.


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
  •