window.addEventListener("beforeunload", function (e) {
alert("still there?");
});
| cs |
It is working well, though can't watch it. This window event just block alert method like this :
If you wanna show alert, you can pop the confirm prompt with this option 'returnValue':
window.addEventListener("beforeunload", function (e) {
(e || window.event).returnValue = "still there?";
});
| cs |
I just use it to change the DB data for transaction. It can be used on service controller like this.
+
댓글 없음:
댓글 쓰기