SecurityError:操作不安全.未捕获的ReferenceError: openDialog is not de

"SecurityError: The operation is insecure." in firefox and "Uncaught ReferenceError: openDialog is not defined" in chrome

本文关键字:openDialog ReferenceError is not de 操作 不安全 SecurityError      更新时间:2023-09-26

我试过了

openDialog('http://stackoverflow.com');

openDialog('http://localhost');

都抛出异常:

  SecurityError: The operation is insecure

 Uncaught ReferenceError: openDialog is not defined
在chrome

openDialog()在所有浏览器中都不可用?

窗口。openDialog是window.open的扩展。它表现为相同,除了它可以选择性地接受一个或多个参数windowFeatures和windowFeatures本身只做了一点处理不同。

所以,如果你不使用额外的参数,使用如下:

window.open(
   "http://localhost",
   "DescriptiveWindowName",
   "resizable=yes,scrollbars=yes,status=yes"
 );

window.open("http://localhost");

如果使用strWindowFeatures参数,则不使用的特性列出的将被禁用或删除(除了标题栏和关闭其中

是的,标题栏和关闭按钮都不可能。