homepage Welcome to WebmasterWorld Guest from 54.227.171.163
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
strict validation
billybonds

10+ Year Member



 
Msg#: 6509 posted 10:49 pm on Oct 30, 2003 (gmt 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

 

billybonds

10+ Year Member



 
Msg#: 6509 posted 10:51 pm on Oct 30, 2003 (gmt 0)

sorry - ignore this. I found the answer in another post....

DrDoc

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



 
Msg#: 6509 posted 10:53 pm on Oct 30, 2003 (gmt 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>

MWpro

10+ Year Member



 
Msg#: 6509 posted 10:54 pm on Oct 30, 2003 (gmt 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">

DrDoc

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



 
Msg#: 6509 posted 10:59 pm on Oct 30, 2003 (gmt 0)

Actually, the language attribute is not required at all, and has become deprecated.

MonkeeSage

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 6509 posted 11:04 pm on Oct 30, 2003 (gmt 0)

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

Jordan

billybonds

10+ Year Member



 
Msg#: 6509 posted 11:07 pm on Oct 30, 2003 (gmt 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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved