function lvs()
{
if(!confirm("你确定要离开吗?"))
location.href = location.href;
else
alert("bye");
}
这不一定是好方法,但是确实行得通……
{
if(!confirm("你确定要离开吗?"))
location.href = location.href;
else
alert("bye");
}
这不一定是好方法,但是确实行得通……
function window.onbeforeunload()
{
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
{
window.event.returnValue="确定要退出本页吗?";
}else
{
alert("你在刷新");
//return false;
}
}
</script>