如何解决HTML适用于除IE 7之外的所有Web浏览器
|| 我的HTML代码有问题。它适用于除IE 7之外的所有Web浏览器。有人可以帮助我理解为什么。我对html有所了解,但是对Java有经验。下面的代码摘录自我的JSP。任何帮助是极大的赞赏。我曾经发布过一次,所有人都把我分开了。请多多包涵。谢谢任何能提供帮助的人。 -问题是html出现在其他浏览器中,但IE返回一个空页面。<html>
<%@include file = \"../common/emxUIConstantsInclude.inc\"%>
<form name=LocationSelectionForm method=\"post\">
<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"3\">
<tr>
<th nowrap> <%=header%></th>
</tr>
<tr> </tr>
<%
int i = 0;
Iterator locationItr = locations.iterator();
while (locationItr.hasNext()){
String loc = (String) locationItr.next();
%>
<tr>
<td nowrap=\"nowrap\">
<%
if (currentLocation!=null && loc.equals(currentLocation)){
%>
<input type=\"radio\" name=\"location\" value=\"<%=loc%>\" checked> <%=loc%>
<%
} else {
%>
<input type=\"radio\" name=\"location\" value=\"<%=loc%>\"> <%=loc%>
<%
}
%>
</td>
</tr>
<%
i++;
}
%>
</table>
</form>
<script language=\"javascript\" type=\"text/javaScript\">//<![CDATA[
<!-- hide JavaScript from non-JavaScript browsers
function setLocation(){
form = document.LocationSelectionForm;
form.action = \"MERPLocationContextProcess.jsp\";
form.submit();
}
//Stop hiding here -->//]]>
</script>
</html>
解决方法
检查您的浏览器缓存(将其重置).. IE的所有版本都有过度缓存的趋势。
, 我看到的第一个HTML错误:
<tr> </tr>
这是无效的HTML。 <tr>
元素必须仅包含<td>
或<th>
元素。
我不知道这是否足以杀死IE7上的渲染,但绝对需要修复。
我看到的第二个错误是您没有<body>
标记(您也只有结束a6ѭ标记,但是您在注释中指出已在粘贴的代码上方打开了该标记)。 <body>
为必填项。同样,不确定是否会破坏渲染,但是它确实有潜力这样做。
, 修正:我需要添加<body>
和</body>
语句:
<html>
<HEAD>
<TITLE>Submitting Radio Buttons</TITLE>
</HEAD>
<BODY>
<%@include file = \"../common/emxUIConstantsInclude.inc\"%>
<form name=LocationSelectionForm method=\"post\">
<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"3\">
<tr>
<th nowrap> <%=header%></th>
</tr>
<tr> </tr>
<%
int i = 0;
Iterator locationItr = locations.iterator();
while (locationItr.hasNext()){
String loc = (String) locationItr.next();
%>
<tr>
<td nowrap=\"nowrap\">
<%
if (currentLocation!=null && loc.equals(currentLocation)){
%>
<input type=\"radio\" name=\"location\" value=\"<%=loc%>\" checked> <%=loc%>
<%
} else {
%>
<input type=\"radio\" name=\"location\" value=\"<%=loc%>\"> <%=loc%>
<%
}
%>
</td>
</tr>
<%
i++;
}
%>
</table>
</form>
</BODY>
<script language=\"javascript\" type=\"text/javaScript\">//<![CDATA[
<!-- hide JavaScript from non-JavaScript browsers
function setLocation(){
form = document.LocationSelectionForm;
form.action = \"MERPLocationContextProcess.jsp\";
form.submit();
}
//Stop hiding here -->//]]>
</script>
</html>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。