火狐浏览器中的form提交问题

<SCRIPT type="text/javascript">
function exit(){
if (!confirm("您确定要注销吗?")){
return;
}
document.getElementById("form1").action = "login/exitLogin.action";
document.getElementById("form1").submit();
alert('注销成功');
window.top.location = '../login/login.jsp';
}
</SCRIPT>
<form id="form1" name="form1"><a onclick="exit(); return false" href="javascript:">注销</a></form>

点击注销,弹出您确定要注销吗?,按确定则注销并页面链接到登陆页面。
此代码在IE9以及chrome浏览器中正常,但在火狐浏览器中不行。
本身此代码是在frame框架的nav层中,火狐浏览器注销后实现注销功能并此nav层定位到登陆界面,而不是整个页面定位过去。

去掉alert则直接跳转到登录页面,不注销
而去掉alert跟window.top.location = '../login/login.jsp';则可以注销。。
以上我测试后的种种问题,火狐浏览器实在无语。求大神~~

第1个回答  2012-01-05
搜来的你试试吧
火狐不支持window.top.location.href("index.html")。解决方法改成 top.window.location = 'index.html';

PS:对于parent,IE可以通过ID和NAME来访问FRAME,而火狐只能用NAME来访问,所以将parent的ID和NAME设为一样的即可以使用“parent.mainFrame.location.href="index.html";”本回答被提问者采纳
第2个回答  2014-05-08
  您好!很高兴为您答疑!

  火狐不支持window.top.location.href("index.html")。您可以使用 top.window.location = 'index.html';火狐下建议安装Firebug配合检查页面代码。
  您可以在火狐社区了解更多内容。希望我的回答对您有所帮助,如有疑问,欢迎继续在本平台咨询。本回答被网友采纳
第3个回答  2012-01-05
神吗啊啊