JS in XHTML

Discussion in 'Web Design, HTML And CSS' started by gameyharp, Nov 6, 2007.

  1. gameyharp

    gameyharp New Member

    Joined:
    Sep 4, 2007
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    I'm having an issue putting JS into xhtml. The tutorial i'm going through at w3schools shows all of the JS in html and not xhtml. Can someone please tell me how to convert it? Heres a little bit of what I have
    HTML:
    <!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    <title>simple document</title>
    </head>
    <body>
    <script type="text/javascript">
    document.write("<h1>Hello World!</h1>")
    </script>
    </body>
    </html>
    The only thing that I think i could be doing wrong is in the document declartion or w/e I shouldn't be using strict I should be using somehting else. All help is appreciated.
     
    Last edited by a moderator: Nov 6, 2007
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice