Reference external page include in HTML static page

Source: Internet
Author: User

It is easy to reference an external page on a JSP page. Use the following statement: <! --Include File= "Page to be referenced"->

But in HTMLStatic PageIt is not that convenient to reference external pages. The main methods are as follows:

1. The framework is used for implementation, but it occupies a large number of threads and is slow;
<IFRAME name = "neepage" width = 100% Height = 30 marginwidth = 0 marginheight = 0 src = "header.htm"> </iframe>
Some of its attributes can achieve some transparency, no scroll bar, and other specific effects. You can refer to the introduction of the HTML tutorial.

2. Use.JSScript implementation

Is to convert the relevant HTML fileJSFile.
<SCRIPT src = "import.JS"> </SCRIPT>
Or <SCRIPT src = "import. asp"> </SCRIPT>, the content in import. asp must beJSEnter.

If you use this method to include headers and navigation bars, it will not be conducive to search engine collection.
In addition, writeJSThe output Content Code is messy and prone to errors.

3. The following is an implementation method:
It is better to have a method, just like when an ASP page contains other pages, you can use a short containing statement. do not show the content to be included in this page, instead, it is split to another page.

<Span id = showimport1> </span>
<Ie: Download id = "odownload1" style = "behavior: URL (# default # download)"/>
<SCRIPT>
Function ondownloaddone (downdata ){
Showimport1.innerhtml = downdata
}
Odownload1.startdownload('top.htm', ondownloaddone)
</SCRIPT>

Note: If the contained page is top.htm, you only need to change the page to be included! Here, id = showimport cannot be changed to others. This method is to include a file at a time.

4. <Object> I personally think this method is more convenient.

<Object type = "text/X-scriptlet" Data = "import.htm" width = 100% Height = 30> </Object>

5. Behavior Download Method

<Span id = showimport> </span>
<Ie: Download id = "odownload" style = "behavior: URL (# default # download)"/>
<SCRIPT>
Function ondownloaddone (downdate ){
Showimport. innerhtml = downdate
}
Odownload.startdownload('import.htm', ondownloaddone)
</SCRIPT>

6. Execute SSL in HTML
In this situation, only index.html is available, but the homepage must be dynamic. In addition to the above method, you can use SSL
[! -- # Exec CGI = "index. pl" --]

1. Open "server-side inclusion" on the server"
2. Change your static file extension to: shtml
3. Add <! --#Include File= "The file you want to include" -->

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.