HTML uses JSP annotations to hide HTML annotations in source code, extending to ASP and PHP

Source: Internet
Author: User
Tags html comment php server

We all know that the use of annotations in HTML is <!----, which has been used for a long time, but this comment can be viewed in the source code.

Although the HTML page has been agreed in advance to write the HTML code is public, the front end is the front end, the front end is not worth the money, but, these HTML comments directly in the source code can be viewed always have a kind of irregular feeling, and this paragraph clearly can be used to hide some tricks.

If it is a JSP page, you may wish to use,

<%----%> to comment, such as the following page:

<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "pageencoding=" Utf-8 "%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >

For example, opening a Web page will not see the JSP comments,


Of course, the premise is that your page must run on the Tomcat server, and the suffix name is. jsp.

In the same vein, it can be extended to ASP and PHP

PHP You use to comment, of course, the premise of the same page ran on the PHP server, and the suffix name is. php

<%php//Comment%>
If it is an old ASP, VBScript, of course, ASP. NET can also experiment, of course, the premise is also you this page ran on IIS, and the suffix is. asp or. aspx:

<% ' asp Comment%>
In this way, the front-end siege Lions no longer have to worry about where their annotations are being seen in the source code.

HTML uses JSP annotations to hide HTML annotations in source code, extending to ASP and PHP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.