" will be ignored by the browser and will not be displayed in the final interface browsed by the user. Although the commented part will be ignored by the browser during execution, you can still see it when viewing the source code in the browser."/> " will be ignored by the browser and will not be displayed in the final interface browsed by the user. Although the commented part will be ignored by the browser during execution, you can still see it when viewing the source code in the browser.">
Home > Article > Web Front-end > Sharing about html, css, javascript and other annotation methods
1. HTML comment method
<!-- html注释:START -->
Content
<!-- html注释:END -->
is contained in “7d10656dd80e85a61cc39b3d42df63be" of HTML comments.
Therefore, if the first line starts with "f5006df9c8de983febba793738d98fe1", JavaScript will ignore both lines, but not these two lines. The part between the lines. And if in JavaScript, the first line starts with "763add2c8cc4f8b8a6339380bc3ef0e0", then the program in between is included in a complete HTML comment, It will be ignored by browsers that do not support JavaScript and cannot be displayed.
In this way, the code can be hidden for browsers that cannot understand JavaScript, but there is no need to hide the code for browsers that can understand JavaScript.
4. ASP annotation method
<% Set xml=Server.CreateObject("Microsoft.XMLDOM") Set Fs=xml.documentElement.childNodes 'ASP注释 %>
5. JSP annotation method
<span style="font-size: 15px;">在JSP中的注释一共分为两种注释:</span><br/><span style="font-size: 15px;"> · 显式注释:在HTML中存在注释“<!--注释内容 -->”</span><br/><span style="font-size: 15px;"> · 隐式注释:可以使用java中的“//”、“/*….*/”,以及JSP中自己的注释:“<%-- 注释内容 --%>”</span><br/><span style="font-size: 15px;"> 所谓是显式或隐式实际上就是指在查看源文件的时候的显示的代码。</span><br/><span style="font-size: 15px;"><%-- JSP中的注释,看不见 --%></span><br/><span style="font-size: 15px;"><%</span><br/><span style="font-size: 15px;"> // 注释,看不见</span><br/><span style="font-size: 15px;"> /*</span><br/><span style="font-size: 15px;"> 注释,看不见</span><br/><span style="font-size: 15px;"> */</span><br/><span style="font-size: 15px;">%></span><br/><span style="font-size: 15px;"><!--显式注释--></span>
Other annotation methods :
For example, vbs uses 'comment or REM comment content
PHP supports C, C++ and Unix style comment methods:
/* C,C++风格多行注释 */ // C++风格单行注释 # Unix风格单行注释
The above is the detailed content of Sharing about html, css, javascript and other annotation methods. For more information, please follow other related articles on the PHP Chinese website!