<script type="text/javascript">
if (window.name == 'default') {
window.name = 'a03d01c6c88549c6a7e05c922961271e';
window.document.getElementById('ctl03').click();
}
else if (window.name == '') {
window.name = 'default';
window.document.getElementById('ctl04').click();
}
else if (window.name == 'invalidAccess') {
if ('FALSE' == 'TRUE')
{
window.name='';
window.document.getElementById('ctl04').click();
}
else
{
window.open('MsgPage_NewWindow.aspx','_self');
}
}
else {
window.name = 'invalidAccess';
window.document.getElementById('ctl04').click();
}
</script>
上面的脚本是由服务器控件在页面上发出的,该控件是一个网页...除了页面之外,页面中没有其他控件...Internet Explorer 将其重定向到页面“Home.aspx”,但是Firefox 只是停留在同一页面...即使它显示任何错误。
你能帮忙吗?我也想知道为什么会这样,因为我必须让整个网络应用程序在FF中工作。
最佳答案
您正在使用仅限 IE 的专有click
方法进行重定向。
您应该编写 location.href = "http://url";
来代替;这适用于所有浏览器。
关于javascript - 为什么这段 javascript 代码不能在 FireFox 中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2517549/