JavaScript 注释的使用技巧
1、最简单的代码形式。// ******:就是最简单的JAVA代码注释语句。这样的语句不会在网页上呈现出来。
2、一稍僚敉视个完整的使用JAVA注释 的文本程序案例。<html><body><script type="text/javascript">// 我这里写标题:document.write("<h1>我的标题</h1>");// 我这里写段落:document.write("<p>我的段落一。</p>");document.write("<p>我的段落二。</p>");</script></body></html>
3、JAVA的多行注释使用技巧。/* */ 这个中间的注释不限定具体的行数。
4、一个多行注释的使用效果呈现。<html><body><script type="text/javascript">/*这是多行代码注释这句话不会展示出来*/document.write("<h1>百度经验</h1>");document.write("<p>越写越棒</p>");document.write("<p>越写越精彩</p>");</script></body></html>
5、如果在代码执行语句前面加上一个//,这个代码就不会执行了。<html><body><script type="text/javascript">document.write("<h1>百度经验</h1>");document.write("<p>我可以出现在网页上</p>");//document.write("<p>我被限制出现了</p>");</script></body></html>
6、如果在代码的前后加上多行注释 之后,这稍僚敉视个代码也就不会执行了。<html><body><script type="text/javascript媪青怍牙">/*document.write("<h1>百度经验</h1>");document.write("<p>我可以出现在网页上</p>");//document.write("<p>我被限制出现了</p>");*/</script></body></html>