Validation: iframe , onmouseover and doctype

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J. B. Moreno

    Validation: iframe , onmouseover and doctype

    I've got a page with an iframe in it, and a javascript that handles an
    onmouseover/onmouseout for it. Everything WORKS, but it doesn't
    validate...

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd"> <html>
    <head>
    <title>test</title>
    </head>
    <body>

    <iframe id='ifID' name='ifName' src='if.html' onmouseover='ov er()'
    onmouseout='out ()'>no content </iframe>

    </body>
    </html>

    What doctype should I be using? Or do I just say forget about it?

    --
    J.B.Moreno
  • Martin Honnen

    #2
    Re: Validation: iframe , onmouseover and doctype



    J. B. Moreno wrote:

    [color=blue]
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    > "http://www.w3.org/TR/html4/loose.dtd"> <html>[/color]
    [color=blue]
    > <iframe id='ifID' name='ifName' src='if.html' onmouseover='ov er()'
    > onmouseout='out ()'>no content </iframe>[/color]
    [color=blue]
    > What doctype should I be using? Or do I just say forget about it?[/color]

    If you want to use the onmouseover/out attributes on the iframe element
    in the markup then I think you need to write your own DTD extending the
    HTML 4 DTD as needed to be able to validate the document without errors.

    Depending on your needs you could of course decide to make the document
    valid against the W3C HTML 4 DTD as far as possible but accept getting
    errors on those two attributes.

    Or you could remove the attributes from the markup and use script to set
    event listeners as needed with script alone.

    --

    Martin Honnen

    Comment

    • J. B. Moreno

      #3
      Re: Validation: iframe , onmouseover and doctype

      Martin.Honnen@g mx.de wrote:[color=blue]
      > J. B. Moreno wrote:
      >[color=green]
      > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      > > "http://www.w3.org/TR/html4/loose.dtd"> <html>[/color]
      >[color=green]
      > > <iframe id='ifID' name='ifName' src='if.html' onmouseover='ov er()'
      > > onmouseout='out ()'>no content </iframe>[/color]
      >[color=green]
      > > What doctype should I be using? Or do I just say forget about it?[/color]
      >
      > If you want to use the onmouseover/out attributes on the iframe element
      > in the markup then I think you need to write your own DTD extending the
      > HTML 4 DTD as needed to be able to validate the document without errors.[/color]

      OK, thanks.
      [color=blue]
      > Depending on your needs you could of course decide to make the document
      > valid against the W3C HTML 4 DTD as far as possible but accept getting
      > errors on those two attributes.[/color]

      Probably best to just let those two errors go -- I'm not fanatical about
      validation, and this seems to be a reasonable case of ignoring it.
      [color=blue]
      > Or you could remove the attributes from the markup and use script to set
      > event listeners as needed with script alone.[/color]

      The scripting on this page is supposed to be handled by someone else.

      --
      J.B.Moreno

      Comment

      Working...