确定何时关闭新窗口

时间:2018-09-07 13:46:18

标签: javascript angularjs

在我的controller.js中,我用window.open();

打开了一个新窗口

我需要开始加载符号,并用window.open();关闭打开的窗口后,我需要停止加载符号。我的示例代码如下。

$scope.showAuditLoadingDiv = true;
window.open("newPage", "_BLANK", "location=yes,height=570,width=520,scrollbars=yes,status=yes");
$scope.showAuditLoadingDiv = false;

1 个答案:

答案 0 :(得分:0)

window.open()返回一个窗口对象...您可以检查其“关闭”属性。示例代码:

var google = window.open("https://www.google.de/");
console.log(google);

setInterval(function () {
    console.log(google.closed);
}, 300);

关闭新窗口时,关闭属性设置为true。

相关问题