Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Xko
    Xko is offline
    New Coder
    Join Date
    Feb 2005
    Location
    Birmingham, England
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Why is this not W3C valid code?

    I am using the below code to display how many visitors are online.

    As i have no JavaScript experience what-so-ever i need your help in finding out why the code is not W3C valid.

    Here's the code...

    Code:
    <script language="javascript" src="http://fastonline.piksites.com/usersonline.php?page=3735422c&single=human&plural=humans"></script>
    And here's a link to the W3C report...

    Clicky clicky!

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    1. the language is a deprecated attribute. W3C recomands now the type

    <script type="text/JavaScript">

    You may use both, if want to
    <script language="JavaScript" type="text/JavaScript">

    2. You mentioned the language javascript but you have called a php file. I doubt it would have worked.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Xko
    Xko is offline
    New Coder
    Join Date
    Feb 2005
    Location
    Birmingham, England
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for that - that solved my last problem i had.

    The one i originally posted was to do with a & sign which should have read &amp;



    Thankyou!

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Quote Originally Posted by Kor
    2. You mentioned the language javascript but you have called a php file. I doubt it would have worked.
    It would if the php file (or any server-side scripts for that matter) outputs javascript codes and sets its content type to 'text/javascript'.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •