Sharing about html, css, javascript and other annotation methods

黄舟
Release: 2017-07-24 11:18:54
Original
1983 people have browsed it

1. HTML comment method

<!-- html注释:START -->
Copy after login

Content

<!-- html注释:END -->
Copy after login

is contained in “" of HTML comments.

Therefore, if the first line starts with "", JavaScript will ignore both lines, but not these two lines. The part between the lines. And if in JavaScript, the first line starts with "", 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  
&#39;ASP注释
%>
Copy after login

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>
Copy after login

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风格单行注释
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template