关于JS判断浏览器关闭的问题 诉求救!!!!!!
我用js判断浏览器是否关闭,给出提示我用的是Jquery
jQuery(function(){ jQuery(window).bind("beforeunload", function(e) { if (!e) e = window.event; returnValue = "是否离开"; e.returnValue = returnValue; return returnValue; }); })<body onunload="alert('页面即将关闭')";>
[解决办法]
类似这样的问题没有万无一失的办法,无法完全区分关闭与刷新,而关闭浏览器的办法又是那么多种.
[解决办法]
<html xmlns="http://www.w3.org/1999/xhtml" ><head> <title>无标题页</title> <script language="javascript" type="text/javascript"> function closeWindow() { window.event.returnValue = "是否关闭"; } </script></head><body onbeforeunload = "closeWindow();"></body></html>