Refresh the browser page in vue to initialize and jump to page a


window.onbeforeunload = onbeforeunload_handler;
function onbeforeunload_handler () {

window.location.href = ". / Product";
var warning= "confirm to exit sssssssssss?";
return warning;

}

window.attachEvent ("onbeforeunload", onbeforeunload_handler ());
always mistakenly say that window.attachEvent is not a function and the page is blank

Apr.01,2022

window.attachEvent is only available in earlier versions of IE.
secondly, your scenario can be implemented with vue-router.


.... Which button you click, you can print the window.attachEvent.

Menu