其中第1种是我常用,其他的方法还未测试
下面代码是page.html里面的,page1和page2和page.html同级
1:
<div id="page1"></div>
<div id="page2"></div>
<script>
$("#page1").load("page1.html");
$("#page2").load("page2.html");
</script>
2:iframe
<div id="page1">
<iframe align="center" width="100%" height="170" src="page1.html" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div>
<div id="page2">
<iframe align="center" width="100%" height="170" src="page2.html" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</div>
3:object引入
<head>
<object style="border:0px" type="text/x-scriptlet" data="page1.html" width=100% height=150>
</object>
</head>
4:import引入
<head>
<link rel="import" href="page1.html" id="page1">
</head>
<body>
<script>
console.log(page1.import.body.innerHTML);
</script>
</body>