...

View Full Version : Why is this not W3C valid code?



Xko
03-07-2005, 02:49 PM
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...


<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! (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.blme.org.uk%2F)

Kor
03-07-2005, 02:56 PM
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.

Xko
03-07-2005, 03:00 PM
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!

glenngv
03-08-2005, 04:33 AM
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'.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum