zoukankan      html  css  js  c++  java
  • 调用网页头部和尾部的公共部分

    动态的页面可以用包含语句把页面引用进来。如果是纯静态页面可以用js来引用。
    动态页面就不举例子了,举个静态页面的吧:index.html:
    原始页面<html>
    <head>
    <title>test</title>
    </head>
    <body>
    <div id="content">test content</div>
    <div id="bottom">bottom</div>
    </body>
    </html>
    下面把这个页面拆分了,首先是top页面:
    top.html:document.write("<html><head><title>test</title></head><body>");
    然后是bottom页面:bottom.html:document.write('<div id="bottom">bottom</div></body></html>');
    最后是浏览的页面index:index.html:
    <script type="text/javascript" src="top.html"></script>
    <div id="content">test content</div><script type="text/javascript" src="bottom.html">
    </script>
    需要注意的是top和bottom页面必须用document.write()语句来输出html,
    最好把所有的html一排输出,如果不能一排输出就要用+号来连接。还要注意单双引号不能混合用,否则会显示不了
    1.asp,shtml 的文件引入命令
    <!--#include file="../include/mayihome_com.asp" -->
    2.php执行文件的引入命令
    <?php include("include/header.php"); ?>
    2.jsp执行文件的引入命令
    <jsp:include page="miniguide.jsp" />
    -----------------------
    以下是web服务器支持的执行文件。
    apache php5支持php
    iis支持asp
    tomcat支持jsp


  • 相关阅读:
    es-07-head插件-ik分词器插件
    es-01-简介
    es-02-elasticsearch安装及遇到的问题
    es-03-DSL的简单使用
    es-04-mapping和setting的建立
    lucene-01-简介
    Scipy---1.常数和特殊函数
    Pandas---12.数据加载和保存
    Pandas---11.移动窗口函数
    Pandas---10.DataFrame绘图
  • 原文地址:https://www.cnblogs.com/snowinmay/p/3017689.html
Copyright © 2011-2022 走看看