在用户关闭浏览器时候给出提示

<script language="javascript">

var timerID = null;

var bRefresh = false;

function quit()

{

 if (!bRefresh)

event.returnValue="注意:真的要关闭吗!";

}

function refresh()

{

 bRefresh = true;

 location.reload(true);

}

timerID = setTimeout("refresh()",10000,"Javascript");

</script>

<body onbeforeunload="quit()">

标签: none

评论已关闭