Click to See Complete Forum and Search --> : Calling for a script gives me invalid HTML


shopkanji
03-25-2005, 12:53 PM
I wasn’t sure if this was an HTML question of a JavaScript question. Since I’m dealing with HTML validation, I’m putting it in this forum. Forgive me if I put it in the wrong forum.

In my HTML code, I have a script tag with source.

<script language="JavaScript" src="float.js"></script>

This works great, but when I try to validate my HTML, I get two errors, “there is no attribute ‘LANGUAGE’” and “required attribute ‘TYPE’ not specified”.

I redid my script tag so it read like this:

<script type="JavaScript" src="float.js"></script>

My page now validates, but the javascript doesn’t work.

I even tried to have both language and type, to see if I only get one error and it still to work, but no luck:

<script type="JavaScript" language="JavaScript" src="float.js"></script>

What am I doing wrong?

I want my javascript to work, but I’ve worked really hard to have valid HTML, and these are my only errors.

Jona
03-25-2005, 12:57 PM
<script type="text/javascript" src="float.js"></script>

ray326
03-25-2005, 01:32 PM
Link it as Jona suggests then open the page in Firefox with the Javascript console open and see if you don't have some bugs. BTW, you don't have <script> tags IN the Javascript file do you?

shopkanji
03-25-2005, 05:43 PM
That fixes my problem perfectly! I used "JavaScript" instead of "text/javascript" thanks Jona and Ray.

Jona
03-25-2005, 06:05 PM
Glad it works for you.