有没有办法在chrome中点击mailto链接时防止onbeforeunload被调用。 在FF,Safari,IE中,它运行良好。
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js">
google.load("jquery", "1.3.2");
</script>
<script type="text/javascript">
$(document).ready(function(){
window.onbeforeunload = confirmExit;
});
function confirmExit() {
return "Are you sure?";
}
</script>
</head>
<body>
<a href="mailto:someone@somewhere.com?subject=test mail&body=Hello%20World">Mail Link</a>
</body>
</html>
onbeforeunload
事件。现在关闭页面:onbeforeunload
被触发但被忽略。 - Qwertiyonbeforeunload
行为的最新更改? - robertcelse
。 - robertc