HTML表单提交导致IE11中的空白页面

时间:2014-06-04 06:03:47

标签: javascript html .net internet-explorer cross-browser

我有一个在dot net 4.0框架上创建的web应用程序,其中UI是用html页面完成的。但是最近我们在IE 11浏览器上面临表单提交的问题。我们提交表单的那一刻结果是空白页面。其他浏览器(Chrome,firefox),甚至降低了IE版本的工作正常。

这个问题的有趣部分是当我在调试模式下运行应用程序时(通过单击f12)它可以正常工作。

有谁知道为什么会这样?

<html>
<head>

<title>xyz</title>


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<script type="text/javascript" language="javascript">
<!--
window.name = "__xyz_APP_WINDOW____";
// -->
</script>
<script language='JavaScript' src='scripts/adminmenu.js'></script>
<script language='JavaScript' src='scripts/utilities.js'></script>
<script language='JavaScript' src='scripts/toolTips.js'></script>
<link rel="stylesheet" href="styles/backoffice.css" type="text/css">
<link rel="stylesheet" href="styles/screen.css" type="text/css" media="screen">
<link rel="stylesheet" href="styles/print.css" type="text/css" media="print">
<script language="javascript" type="text/javascript" src="scripts/jquery-min.js"></script>

<script language="JavaScript">
<!--

function checkFormData()
{
  do
  {
    var el = getForm().elements["uid"];
    if (!trimAll(el.value).length) break;
    el = getForm().elements["pwd"];
    if (!trimAll(el.value).length) break;
    getForm().elements["_tz_offset"].value = (new Date()).getTimezoneOffset().toString();
    return true;
  } while(0);
  alert(errorMessage[el.name]);
  el.focus();
  return false;
}

var errorMessage = new Array();

errorMessage["uid"] = "Please enter a Login ID";
errorMessage["pwd"] = "Please enter a password";

function handleEnter(anElement)
{
  if (13 == self.event.keyCode)
  {
    if ("uid" == anElement.name)
    {
      anElement.form.elements["pwd"].focus();
    }
    else if ("pwd" == anElement.name)
    {
      if (checkFormData()) anElement.form.submit();
    }
    self.event.returnValue = false;
  }
}


//-->
</script>

</head>
<body bgcolor="#FFFFFF" background="images/bkgd_BackOffice.gif" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" class="DetailBody" onLoad="getForm().elements['uid'].focus();">
<form name='adminForm' method='POST' onsubmit="return checkFormData()" >

  <input type="hidden" name="CurrentPage" value="admin_login"/>
  <input type="hidden" name="TargetPage" value="admin_index"/>
  <input type="hidden" name="_tz_offset" />
  <table width="800" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td bgcolor="#000000"><img src="images/spacer.gif" width="3" height="1"></td>
    </tr>
    <tr>
      <td><img src="images/masthead_BackOffice_OSP03.jpg" width="800" height="100"></td>
    </tr>
  </table>
  <table width="800" border="0" cellspacing="0" cellpadding="0">
    <tr valign="top"> 
      <td align="center"> 
        <table width="60%" border="0" cellpadding="10" cellspacing="0">
          <tr> 
            <td> 
              <p class="h1">Back Office Login</p>
              <p>The Back Office is reserved </p>
                 <script type ="text/javascript" language="JavaScript">
<!--
                     var correctBrowser = ((BrowserDetect.browser == "Safari" || BrowserDetect.browser == "Chrome") && BrowserDetect.OS == "Mac") ||
                      ((BrowserDetect.browser == "Explorer" || BrowserDetect.browser == "Chrome") && BrowserDetect.OS == "Windows");
                     //var correctBrowser = (BrowserDetect.browser == "Safari" && BrowserDetect.OS == "Mac") || (BrowserDetect.browser == "Explorer" && BrowserDetect.OS == "Windows");
                     var IsIE10OrIE11 =(BrowserDetect.browser == "Explorer" && BrowserDetect.OS == "Windows" && (BrowserDetect.version=="10" || BrowserDetect.version=="11" ));
                     if (!correctBrowser) {

                         document.write('<p><b><font color="#CC3333">PLEASE NOTE:</font></b> you are currently using <b>' + BrowserDetect.browser + ' ' + BrowserDetect.version + '</b> on <b>' + BrowserDetect.OS + '</b>. The OrderStream Pro Back Office works best with <a href="https://www.google.com/intl/en/chrome/browser/" target="_blank"><b>Chrome</b></a>.</p>');
                     }

                     if (IsIE10OrIE11) {
                         document.write('<p><b><font color="#CC3333">PLEASE NOTE :</font></b>  you are currently using <b>' + BrowserDetect.browser + ' ' +
                      BrowserDetect.version + '</b> on <b>' + BrowserDetect.OS + '</b>. This browser is not compatible for reporting tools but can be easliy made compatible.<a href="Instruction.htm" target="_blank"><b>Click here </b></a> to see the instruction for making it compatible. </p>');
                     }


// -->
    </script>

              <table cellpadding="2" cellspacing="0" border="0" align="center">
                <!--vx_ErrorTextStart-->
                <tr> 
                  <td align="right">&nbsp;</td>
                  <td><b><font color="#CC3333">^vx_ErrorText^ </font></b></td>
                </tr>


                <!--vx_ErrorTextEnd-->
                <tr> 
                  <td align="right"><b>Login ID: </b></td>
                  <td > 
                    <input name="uid" maxlength="65" onFocus="select()" onKeyPress="handleEnter(this)" tabindex="1" style="width:120px;" value="^vx_uid^" size="10">
                  </td>
                   </tr>
                <tr> 
                  <td align="right"><b>Password: </b></td>
                  <td> 
                    <input name="pwd" autocomplete="off" maxlength="65" onFocus="select()" type="password" onKeyPress="handleEnter(this)" style="width:120px;" size="10" tabindex="2">
                  </td>
                </tr>
                <tr> 
                  <td></td>
                  <td><a href="javascript:getPage('admin_forgot')">forgot 
                    your password?</a></td>
                </tr>
                <tr> 
                  <td></td>
                  <td> 
                    <input type="submit" name="Submit" value="Submit" class="buttonBlue8pt" tabindex="4">
                  </td>
                </tr>
              </table>
              <p>&nbsp;</p>
            </td>
          </tr>

          <tr>

          <td align="center">
          <div><iframe src="Footer.htm" frameborder="0" width="100%" ></iframe></div>
          </td>

          </tr>

        </table>
      </td>
    </tr>
  </table>
</form>
<!--monitormarker-login-->
</body>
</html>

1 个答案:

答案 0 :(得分:1)

此类问题的最佳解决方案是在浏览器中使用开发者控制台(在这种情况下,通过按F12键入IE 11)。

使用网络选项卡中的打开的开发人员工具(F12)在IE中加载页面(Ctrl + 4)。不要忘记通过单击工具栏顶部的“运行”按钮启用网络流量捕获,或者只需按F5键。

双击带有错误的URL,然后查看响应正文以获取详细信息。