This article describes the configuration usage of the include in HTML, so that the HTML file can also implement the include feature, and now let's take a look at this article about HTML include.
Let's start by introducing what the include tag is in
How to introduce public code to include static pages and include static pages
For a long time, our front-end uses the include function of php to introduce public Code such as header and footer, as shown below:
Document page subject
Students who write the page often encounter such a problem, that is, more and more HTML tags on the page, it will be difficult to find the specified part, then can be written in different files like JavaScript to introduce it? The answer is yes,
The include directive is the compile-time directive, where the content of the files included in the include is inserted into the JSP file when compiling, and the JSP engine infers that the JSP page has not been altered, otherwise it is considered
The include directive is the compile-time directive, where the content of the file included in the include is inserted into the JSP file when it is compiled, and the JSP engine determines that the JSP page has not been modified, otherwise it is
For a simple example, such as the following HTML file (named index.html):A simple text box and a button, I now want to write the button part of the HTML in another. html file (for example, called btn.html) and then introduced into the index.html,
Problems when introducing HTML files with the include directive in JSPs:JSP and HTML can be correctly displayed, when the JSP introduced HTML Access JSP page HTML garbled, JSP original output no garbled, solution:In the first line of HTML join: The
The include directive is the compile-time directive, where the content of the file included in the include is inserted into the JSP file when it is compiled, and the JSP engine determines that the JSP page has not been modified, otherwise it is
1. The include () include (pathtofilename) include () statement will include a file at the location where it is called. A file contains the same content as the data copied to the file where the statement is located. Parentheses can be ignored when
Dynamic include uses Jsp:include action to implement It always checks for changes in the included files, is suitable for containing dynamic pages, and can take parameters.Static include is implemented with the include pseudo-code and will not check
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.