ask before close tab chrome jquery code example Example: js ask before close window.onbeforeunload = function() { return ""; }