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>&nbsp;</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>&nbsp;</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>&nbsp;</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>