Window.open javascript函数在Mozilla中不起作用,但在其他浏览器中起作用,这是我写的。
<a href="javascript:window.open('../Terms.aspx','Terms','width=550,height=400')">
click here</a>
实际上,Mozilla
中发生的情况是弹出窗口已打开,但父窗口为空白,[object Window]
请告诉我我做错了什么?
谢谢
最佳答案
脚本看起来没问题,问题可能在于您在 URL 中运行它。请改用点击事件。
此外,您还可以在链接中使用 href 和 target 属性使其正常降级。这样,即使浏览器中禁用了 Javascript,链接至少也会打开页面:
<a href="../Terms.aspx" target="Terms" onclick="window.open(this.href,this.target,'width=550,height=400');return false;">
click here</a>
关于asp.net - Window.open javascript 函数在 Mozilla 中不起作用,但在其他浏览器中起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2468763/