【发布时间】:2014-12-11 15:27:59
【问题描述】:
我有 IE 版本 11.0.9600.17358
window.open('editProperties.php?fileid=661BEAB9735A615D65B3FCF676A2F83F', 'editProperties', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=570,height=580,left=490,top=362');
抛出无效参数错误。我尝试创建一个 test.html 并仅按名称调用它:
window.open('test.html')
它不起作用,抛出同样的错误。只有一次我能够使用它:
window.open('', 'editProperties','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=570,height=580,left=490,top=362')
或
window.open('about:blank')
只要我将 url 作为第一个参数传递,它就会抛出错误。有人有什么想法吗?
【问题讨论】:
-
我很确定你必须传入完整的 URL,以 http(s) 开头。
-
@Halcyon 我已经尝试过传递 window.open('internal.website.com/…', '','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0, resizable=1,width=570,height=580,left=490,top=362');
-
@Huangism 我已经读过了。我已经传递了完整的 url,我已经确保 name 参数没有任何空格或奇怪的字符。
-
@PersyJack 你能在jsfiddle.net 上重现这个吗?我试过你的脚本,它在我的 IE 11 VM 上运行良好。您是否 100% 确定错误来自打开的窗口?
标签: javascript internet-explorer window.open