# Deployment defile usage example in html _ HTML/Xhtml _ webpage Creation

Source: Internet
Author: User
This article mainly introduces the use of # includefile in html. I personally think the tutorial is good and suitable for beginners. If you need it, you can refer to the following two files a.htmand B .htm. the.htm content in the same directory is as follows:

The Code is as follows:




B .htm content:

Today: Rain 31 ℃ ~ 26 ℃
Tomorrow: thundershower 33 ℃ ~ 27 ℃

Open a directly in the browser without any display. Later, we knew that the include was SSI (Server Side was deprecated, And the.htm was changed to. aspx, and publish the page on iis, and then. you can see the content in aspx. To achieve this in html, you can use the iframe tag and find an example on the Internet:

The Code is as follows:




# Include file Usage in html

Parameters

PathType

Set the path type of FileName. A path can be of the following types:

Path type description

The file name is the relative path of the directory where the document with the # include command is located. The contained file can be in the same directory or subdirectory, but it cannot be in the upper directory of the page with the # include command.
The Virtual File name is the complete virtual path of the virtual directory on the Web site.

FileName

Name of the file to be included. FileName must contain extension of the file name, and the file name must be enclosed by quotation marks.

Note

Files containing the # include command must use the file extension mapped to the SSI interpreter; otherwise, the Web server will not process the command. By default, the extension. stm,. shtm, And. shtml are mapped to the interpreter (Ssinc. dll ). If the Internet Service Manager is installed, you can modify the default extension ing and add a new ing. See set application ing. The included files can have any file extension, but it is recommended that they be assigned a. inc extension.

Example







Differences between include file and include virtual

1. # include the relative path of the file containing the file, # include the virtual path of the file containing the virtual file.
2. In the same virtual directory, And The results are the same, but if the virtual directory is named myweb You can also debug it, but we know that Yes.
3. if a website has two virtual directories: myweb1 and myweb2, myweb1 has a file file1.asp, and myweb2 has a file file2.asp. If file1.asp wants to call file2.asp, write it like this in file1.asp: In this case, # include file cannot be used. An error is inevitable. On the contrary, files in myweb2 that contain myweb1 are the same. If the contained file is under a folder, you only need to add the folder to the virtual path.
4. Whether using # include file or # include virtual, using "/" or "/" in the path does not affect the compilation effect, and the program runs smoothly.
5. the above situations do not apply to the mutual calls of two site files, and within the same site, And It is equivalent to website. Yes.

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.