如何在其他HTML页面中包含HTML页面 [英] How to include HTML page In other HTML page

查看:83
本文介绍了如何在其他HTML页面中包含HTML页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,



我想在其他页面中包含html页面

敌人前。 home.html和footer.html

i希望在home.html页面中包含footer.html。

当运行home.html和(ctrl + U)时查看源代码两个页面代码都是

想要显示。



请帮帮我。



先谢谢。



问候,

Ravi Walde

解决方案

< blockquote>请参考以下链接获取答案,因为使用可以使用



< div data-include =/ path / to / include .html>< / div> 







http://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html -file [ ^ ]


您好,



要使解决方案1正常工作,您需要包括e文件csi.js,您可以在其中找到此处 [ ^ ]。



根据GitHub上显示的示例,要使用此库,您必须包含在页眉中输入csi.js文件,然后你需要在容器元素上添加data-include属性及其值设置到你想要包含的文件。



 <   html  >  
< head >
< script src = csi。 js > < / script >
< / head >
< body >
< div data-include = Test.htm > < / div >
< / body >
< <跨度class =code-leadattribute> / html >





...希望它有所帮助。


Hello All,

I want to include html page in other page
foe ex. home.html and footer.html
i want to include footer.html in home.html page.
and when run home.html and (ctrl+U) view source code both page code will be
want to show.

please help me.

Thanks In advance.

Regards,
Ravi Walde

解决方案

Please refer this link below for your answer as use can use

<div data-include="/path/to/include.html"></div>




http://stackoverflow.com/questions/8988855/include-another-html-file-in-a-html-file[^]


Hi,

To get Solution 1 working you need to include the file csi.js, which you can locate here[^].

As per the example shown on GitHub, to use this library you must include the file csi.js in your page header, then you need to add the data-include attribute with its value set to the file you want to include, on the container element.

<html>
  <head>
    <script src="csi.js"></script>
  </head>
  <body>
    <div data-include="Test.htm"></div>
  </body>
</html>



... hope it helps.


这篇关于如何在其他HTML页面中包含HTML页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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