xhtml 1.0 strict with javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sergio del Amo Caballero

    xhtml 1.0 strict with javascript

    Hello,
    I want to validate my simple page with xhtml 1.0 strict. But i want to
    use javasript inside. When i try the validator the answer is:

    Error:
    # Line 33, column 39: there is no attribute "onClick"
    <a href="http://www.marca.com" onClick="newwin dow();return false">Click
    Here!<..

    newwindow is a function.

    How can i use javascript inside xhtml 1.0 using for example onClick or
    onMouseover with a valid xhtml 1.0?.

    My Doctype is this:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">

    Waiting for your feedback.

    --
    Sergio del Amo.

  • Jim Ley

    #2
    Re: xhtml 1.0 strict with javascript

    On Wed, 15 Oct 2003 12:59:34 +0200, Sergio del Amo Caballero
    <sergi@sbox.tug raz.at> wrote:
    [color=blue]
    >I want to validate my simple page with xhtml 1.0 strict.[/color]

    Why use XHTML 1.0 strict, so few browsers support this, HTML 4.01
    strict is much more supported, I'd recommend switching to that - tidy
    will automate it for you.

    (or alternatively you can read the actual xhtml documentation and note
    that attributes are all lower case)

    Jim.
    --
    comp.lang.javas cript FAQ - http://jibbering.com/faq/

    Comment

    • bengee

      #3
      Re: xhtml 1.0 strict with javascript

      Sergio del Amo Caballero wrote:[color=blue]
      > Error:
      > # Line 33, column 39: there is no attribute "onClick"
      > <a href="http://www.marca.com" onClick="newwin dow();return false">Click
      > Here!<..[/color]

      Weird... i've got this in my XHTML 1.0 Strict page...

      <a href="#" onclick="someFu nction();">clic k here</a>

      .... and it validates perfect. Try that?

      bengee

      Comment

      • Sergio del Amo Caballero

        #4
        Re: xhtml 1.0 strict with javascript

        Thanks for the feedback, i proved in lower case and validate perfectly.

        Comment

        • bengee

          #5
          Re: xhtml 1.0 strict with javascript

          Sergio del Amo Caballero wrote:[color=blue]
          > Thanks for the feedback, i proved in lower case and validate perfectly.[/color]

          That sounds right. I read somewhere that all XHTML tags and elements
          need to be in lowercase.

          bengee

          Comment

          • Richard Hockey

            #6
            Re: xhtml 1.0 strict with javascript

            in XHTML all the javascript events should be in lower case, i.e.: onclick,
            onmouseover, onblur etcetera

            "Sergio del Amo Caballero" <sergi@sbox.tug raz.at> wrote in message
            news:3f8d288d$0 $24956$3b214f66 @aconews.univie .ac.at...[color=blue]
            > Hello,
            > I want to validate my simple page with xhtml 1.0 strict. But i want to
            > use javasript inside. When i try the validator the answer is:
            >
            > Error:
            > # Line 33, column 39: there is no attribute "onClick"
            > <a href="http://www.marca.com" onClick="newwin dow();return false">Click
            > Here!<..
            >
            > newwindow is a function.
            >
            > How can i use javascript inside xhtml 1.0 using for example onClick or
            > onMouseover with a valid xhtml 1.0?.
            >
            > My Doctype is this:
            >
            > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
            > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
            > <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
            >
            > Waiting for your feedback.
            >
            > --
            > Sergio del Amo.
            >[/color]


            Comment

            Working...