手把手教你在html中引入另一个html文件的方法(详解)
导读:收集整理的这篇文章主要介绍了手把手教你在html中引入另一个html文件的方法(详解),觉得挺不错的,现在分享给大家,也给大家做个参考。htML中引入调用另一个html的方法,尝试了好几种,都列出来: 其中第一种是最好的,其他的方法,可以尝...
收集整理的这篇文章主要介绍了手把手教你在html中引入另一个html文件的方法(详解),觉得挺不错的,现在分享给大家,也给大家做个参考。htML中引入调用另一个html的方法,尝试了好几种,都列出来:
其中第一种是最好的,其他的方法,可以尝试看看,是不是适合你当前项目
一、p+$(“#page1”).load(“b.html”)
参考代码:
body>
p id="page1">
/p>
p id="page2">
/p>
script>
$("#page1").load("page/Page_1.html");
$("#page2").load("page/Page_2.html");
/script>
/body>
二、iframe
参考代码:
head>
/head>
body>
p id="page1">
iframe align="center" width="100%" height="170" src="page/Page_1.html" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no">
/iframe>
/p>
p id="page2">
iframe align="center" width="100%" height="170" src="page/Page_2.html" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no">
/iframe>
/p>
/body>
三、object引入
参考代码:
head>
object style="border:0px" tyPE="text/x-scriptlet" data="page/Page_1.html" width=100% height=150>
/object>
/head>
四、import引入
参考代码:
head>
link rel="import" href="page/Page_1.html" id="page1">
/head>
body>
script>
console.LOG(page1.import.body.innerHTML);
/script>
/body>
参考文章:https://www.web-tinker.COM/article/20637.html
五、bootstrap的panel组件,或者easyui的window组件,有点类似这个效果.
感谢大家的阅读,希望大家收益多多。
本文转自: https://blog.csdn.net/arvin0/article/details/56839242
推荐教程:《HTML教程》
以上就是手把手教你在html中引入另一个html文件的方法(详解)的详细内容,更多请关注其它相关文章!
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: 手把手教你在html中引入另一个html文件的方法(详解)
本文地址: https://pptw.com/jishu/590869.html
