In the following example the comment is used to prevent the execution of a single code line (can be suitable for debugging):
Example
<script type="text/javascript">
//document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph.</p>");
document.write("<p>This is another paragraph.</p>");
</script> 

In the following example the comment is used to prevent the execution of a code block (can be suitable for debugging):
Example
<script type="text/javascript">
/*
document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph.</p>");
document.write("<p>This is another paragraph.</p>");
*/
</script> 


This entry was posted on 6:45 AM and is filed under , . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

0 comments: