开发者

Why does the <%@ include directive render correctly in IE but not Firefox or Chrome(latest versions)

开发者 https://www.devze.com 2023-03-26 08:47 出处:网络
I\'m trying to include a html file using the following syntax: <%@ include file=\"path/to/file.开发者_StackOverflow社区html\" %>

I'm trying to include a html file using the following syntax:

<%@ include file="path/to/file.开发者_StackOverflow社区html" %>

But I encounter problems when browsing the page using Firefox(latest) and Chrome(latest) and possibly others which I haven't tested. This include works fine on IE 9 as far as I can see.

Can anyone explain this?

Note:

The parent file is index.html and I suspect that that include directive only applies to *.jsp files, but I cannot confirm this as I am working in a directory where I have only read permissions!


The parent file is index.html

Rename it to index.jsp. This way the <%@include%> will run. It's JSP, not HTML. JSP runs on webserver, not webbrowser. Webbrowser only understands HTML. The interpretation of the -for the webbrowser- unknown <%@include%> tag depends on the webbrowser used and is undetermined.

0

精彩评论

暂无评论...
验证码 换一张
取 消