分割一个html页面并通过标题加载它? [英] Splitting up a html page and loading it through header?

查看:114
本文介绍了分割一个html页面并通过标题加载它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是HTML5,并希望通过将标准HTML模板分成三个独立的HTML文件来加快创建和编辑标准HTML模板的速度。 b
$ b $ ul

  • header.html

  • content.html(将会被编辑,并且会有其他名称,例如首页)

  • footer.html



  • 我看过以下资源,但我不知道这是可能的或如何去做。



    http://www.w3schools.com/html/html_head.asp



    http://www.w3schools.com/tags/tag_link.asp



    在PHP中,我只是按照正确的顺序包含这些文件。在纯HTML网站中是否有一个equivelant?



    我已经使用了这个,但我不认为我正在寻找合适的术语。感谢您的时间!

    div>

    对于只是一个静态的HTML网站,没有像只用html这样的方法来包含文件的方式。您可以根据您的服务器使用服务器端包括,但到那时,您可能只需使用PHP。



    另一个选择是在网页的主要部分已经加载后大量使用Javascript加载页面部分。



    尽管如此,由于服务器请求速度缓慢,性能大幅降低。如果您需要使用模板,只需使用像PHP这样的动态语言。


    I am using HTML5, and would like to speed up the creation and editing of my standard HTML template by splitting it into three separate HTML files.

    • header.html
    • content.html (this will be edited and will have other names e.g. home)
    • footer.html

    I have looked at the following resources, but I am not sure if this is possible or how to go about it.

    http://www.w3schools.com/html/html_head.asp

    http://www.w3schools.com/tags/tag_link.asp

    In PHP I would just include the files in the right order. Is there an equivelant in just a plain HTML site?

    I have googled this, but I don't think Im searching for the right term. I would appreciate any information, or resources available!

    Thanks for your time!

    解决方案

    For just a static HTML site, there is no html-only way to include files the way you are trying to. You may be able to use server-side includes depending on your server, but by that point, you might as well just use PHP.

    Another option would be to make extensive use of Javascript to load the page pieces after the main part of the page is already loaded.

    In all cases, though, you will have a major reduction in performance, since a server request is slow. If you need to use templates, just use a dynamic language like PHP.

    这篇关于分割一个html页面并通过标题加载它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆