我正在尝试将一个html文件包含在另一个html文件中。include用作菜单和页脚。我正在使用当前的include语法,但是我的html数据没有显示在页面上。我的包含文件位于根目录。我试过了:
<!--#include virtual="header.html" -->
<!--#include file="navigation.html"-->
<html>
<head>
<title>test</title>
</head>
<body>
<!--#include virtual="header.html" -->
<!--#include virtual="navigation.html"-->
<p>test<p>
<!--#include virtual="footer.html"-->
</body>
</html>发布于 2011-02-02 19:49:42
检查您的服务器是否启用了服务器端包含(SSIs)。
编辑:另外,您应该删除位于html标记之前的第一组includes这是无效的。
发布于 2011-02-02 19:51:24
Apache webserver?您是否启用了"mod_include“?您是否在.htaccess或httpd.conf中设置了"Options +Includes“?
发布于 2011-02-02 19:50:31
包括是服务器端的,你需要将主文件保存为.asp文件,并在服务器上使用它(假设你的服务器启用了ASP,你的语法肯定会让它看起来像是这样)。
https://stackoverflow.com/questions/4874084
复制相似问题