我对 IE(测试版本 6 和 8)问题有很大的疑问。Window.open 方法在 FF、Opera、Chrome 中正常工作。IE 打开新窗口,但在主窗口中加载相同的 url。我知道一种解决方案是从 href 中删除 url,但我需要它来关闭 JS 的情况。我也需要为新窗口定位。
IE“错误控制台”说:访问被拒绝。
<script type="text/javascript">
function regForm()
{
var left = Math.abs((window.innerWidth - 550) / 2);
var top = Math.abs((window.innerHeight - 600) / 2);
window.open("http://somepage.html", "Signin", "width=550,height=600,scrollbars=1").moveTo(left, top);
}
</script>
<a class="ibm-b1-bttn" href="http://somepage.html" onclick="javascript:regForm(); return false;">Register Now</a>
请帮助我,这对我来说非常重要。非常感谢!