I was reading jQuery documentation for the function .unload()
given in the jQuery API Documentation
It is written clearly that .unload()
will is deprecated in versions after 1.8 and removed completely in 3.x.
I have a local intranet application that is dependent upon this .unload()
function.
Do I have to manually rely on window.onbeforeunload
function and see that a particular browser supports this or not, or can anyone help me in finding a more generic solution for the same.
As suggested by Kevin, I tried
$(window).on("unload", function(e){
return confirm("Do you really want to exit");
});
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
Testing JQuery Unload in 3.x Version
But it is not working