Comment

Description Attributes Examples Tips

Description:

This tag begins and ends a comment block. This is useful for documenting your HTML page and for indicating copyright notices. Perhaps one of the most useful things to do with comments is to place script blocks within comments. This prevents browsers that do not understand scripts from generating errors.

Attributes:

None

Examples:

<!-- Copyright (c) 2000 by Richard Lowe -->

A quick single line comment.

<SCRIPT LANGUAGE="javascript">
<!--//

var jsparamSPR = "CHS";
var jsparamT1 = "7d";
var jsparamSG = "";
var jsparamFR = "0";
var jsparamPSL = "0";
var jsparamLQ = "";
var jsparamT = "B";
var jsparamA = "T";
var jsparamS = "F";
var jsparamKT = "ALL";
var jsCorrectLanguage = false;
var jsSupportServer = "support.microsoft.com";
var jsMSComServer = "www.microsoft.com";

//-->
</SCRIPT>

Here comments are used to hide the contents of a script from browsers that do not understand scripting. As you can see from this example, a comment can be comprised of more than one line.

Tips:

  1. Use comments around script blocks. This ensures that your scripts do not generate errors in older browsers.

  2. Be very sparing with other comments. These are characters within your HTML files just like anything else. They will slow down the load time of your pages.

Internet Tips Contents
404 Errors Advertising Autoresponse Awardmaster Basics Browsers Careers Chatting Disasters Domains Email Emoticons Ezines Free Stuff Fun Stuff FTP Graphics Homepages HTML Reference HTML Tutorial Interactive Legal Links Msg Boards Microsoft Money Multimedia Networks Newsgroups Newsletter Products RFC's Ringmaster Searches Security Sticky Sites Surfing TANSTAAFL Telnet Viral Webmaster Your System