sample.htmlbeforeunload Safari浏览器IFRAME问题
<html>
<head>
<script type="text/javascript">
window.onbeforeunload = function (e) {
e = e || window.event;
// For IE and Firefox prior to version 4
if (e) {
e.returnValue = 'Any string';
}
// For Safari
return 'Any string';
};
</script>
</head>
<body>
<h1> <a href="http://www.yahoo.com"> Yahoo</a> </h1>
</body>
</html>
main.html中
<html>
<body>
<iframe src="sample.html" width="100%" height="300">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
所以问题是,当我在雅虎的链接onbeforeunload功能点击是没有得到调用。
我已经提供了代码和更多信息供您参考。请看看.. – Abhimanyu