You are here: Re: Someone please help! WC3 Validation problems « HTML « IT news, forums, messages
Re: Someone please help! WC3 Validation problems

Posted by cwdjrxyz on 06/09/06 21:32

Jeremy Brown wrote:

> 4. Your embedded scripts appear to be a little off. From what I have learned
> (which is very little) they should look like this:
>
> <script>
> <!--//
> script stuff here
> //-->
> </script>

The script tag should read:

<script type="text/javascript">
/* Instead of this script comment, script goes here */
</script>

If an external script is used, the script tag should be:

<script type="text/javascript" src="url of external script">
</script>

When using an external script, the script code at the url given must
not contain an opening and closing script tag since these are given in
the call for the external script on your main page. Adding extra
opening and closing script tags here can cause the script to fail.

The <!--// and //--> are hangovers from the very early days of
javascript when a few very early browsers could not handle script and
would display the script code on the page instead. This has now long
been unnecessary and may even cause a problem in the most recent forms
of xhtml/xml. If you use this notation at a post at
comp.lang.javascript, more often than not someone will point this out.

Using language in the script tag is outmoded and is now an error in
some higher forms of xhtml/html/xml and also will draw comments at the
mentioned javascript group. The type specification is absolutely
required in W3C html from html 4 to the most recent forms of xhtml.

When using a document.write that writes a closing tag, the closing tag
must be backslashed. for example: document.write('\/div'); . The
reasons for this are rather technical and failure to use the backslash
often will cause no problems. However, the W3C validator will find an
error everytime you fail to backslash a closing tag in a
document.write.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация