我正在尝试在 Google Chrome 中查找窗口/标签关闭事件。在 goole chrome 中,unload() 不起作用。所以我用
<body onbeforeunload="return OnBeforeUnLoad ()">
javascript代码:
function OnBeforeUnLoad() {
return "Your tutorial will be finished unexpectedly";
}
它在 Chrome 中运行良好。但它会引发 chrome 的默认弹出窗口。我想要我自己的弹出框。
那么我该怎么做呢?