Welcome to WebmasterWorld Guest from 23.22.220.37

Forum Moderators: incrediBILL

Message Too Old, No Replies

strict validation

     
10:49 pm on Oct 30, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 30, 2003
posts:54
votes: 0


I am trying to achieve the above and have the same problem as a previous poster (thread too old for me to add to)

"I ran my webpage thru the html validator. here is my doc type.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
The page fails the validation because I have some javascript on the page.
<script language="javascript" type="test/javascript"

This is what the html validator doesn't like. Is there a way to make it compliant with this doc type?"

He or she was advised to remove the language attribute and said that this worked but when I try this the script stops working. How should that be done?

Thanks,

jim

10:51 pm on Oct 30, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 30, 2003
posts:54
votes: 0


sorry - ignore this. I found the answer in another post....
10:53 pm on Oct 30, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 15, 2002
posts:6807
votes: 0


The script stops working? Which browser?

The correct way of invoking JavaScript is:

<script type="text/javascript">
document.write("this is an example");
</script>

10:54 pm on Oct 30, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 29, 2002
posts:533
votes: 0


I'm not sure if you need the language attribute... I think it is only required in the head section for functions (could be wrong.)

You have:
type="test/javascript">

Make it:
type="text/javascript">

10:59 pm on Oct 30, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 15, 2002
posts:6807
votes: 0


Actually, the language attribute is not required at all, and has become deprecated.
11:04 pm on Oct 30, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 26, 2003
posts:881
votes: 0


The language attribute is an IE relic to distinguish JScript from VBScript before inline typing was supported, IIRC.

Jordan

11:07 pm on Oct 30, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 30, 2003
posts:54
votes: 0


thanks for all your advice... sorry i should have read on more before posting.

now if I can just refer you to my new post above.....!

thanks

jim

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members