关于模板include

浏览:1821 发布日期:2014/06/19 分类:求助交流 关键字: include 模板
问题是这样的,我新建了一个模板index.html,其它的有head.html,foot.html,以及中间的homecontent.html,aboutcontent.html。。。等,其中的index.html内容为:
<html>
<head>
</head>
<body >
<include file="Index/head" />
<button onclick="myclick()">首页</button>
<div id="content"></div>


<script type="text/javascript">
function myclick(){
var str='<include file="Index/homecontent"/>';
document.getElementById("content").innerHTML= str;
alert(str);


}
</script>
<include file="Index/foot" />
</body>
</html>

想实现,随点击按钮的不同,content DIV能够动态加载homecontent.html,aboutcontent.html等内容
最佳答案
评论( 相关
后面还有条评论,点击查看>>