Using XHTML/HTML Comments
The following are examples of XHTML comments:
Why use XHTML Comments
The one I use the most is "Marking Out Text or Script Blocks". If you are familiar with Google Adsense then you know that Google provides you with the Adsense code which you simply paste into the document. The code is usually JavaScript and is not always commented. If you just paste the code into your web page then what happens in a few weeks when you want to locate the code to replace it. Google also limit the number of Adsense units on the page, currently to 4. How do you check that you haven't exceeded that amount? Well what I do is to enclose the Google script in comments. So my script instead of looking like this:
Instead looks like:
Inserting HTML/XHTMLCommentsBecause XHTML comments are hidden in most WYSIWYG web page editors you simply can't just type them on the page. Most editors have an XHTML or source option were you can edit the XHTML directly. However most editors also have the ability to insert a comment without going into the XHTML. For FrontPage, Trellian WebPage and NVU users choose Insert>comment and a comment box appears just type in the comment without the XHTML/HTML tags (they are inserted by the editor). Other editors will no doubt be similar You should note that you will not be able to see the comments you just inserted unless you switch to XHTML/source mode.
Related Articles and Resources: |
||||
|
|