0
我有一個站點使用窗口onbeforeunload函數,但點擊彈出不起作用,因爲它。我怎麼可以在彈出的代碼集成的代碼禁用窗口onbeforeunload函數在鏈接
window.onbeforeunload="null";
下面
<script type='text/javascript'>
function ouvre(fichier) {
ff=window.open(fichier,"popup","width=600px,height=300px,left=50%,top=50%") //this._try = 1; setTimeout('this._try = 1;', 4000); } function playMovie(_try) { if (this._try == 1) { playlavideo(); } else { alert('You must share the video to play.'); } }
</script>
<a href="#" onClick="ouvre('http://www.facebook.com/sharer.php?u=http://google.com/');return false"><img src="http://i.imgur.com/GnqwI.jpg" width="500" height="145" border="0"></a>
我試過了,但沒有奏效 – 2012-07-18 17:43:49
我用一個適合我的版本更新了答案,你可以再試一次嗎? – mogelbrod 2012-07-18 17:54:49
是它的工作感謝,但彈出窗口是在同一窗口中打開 – 2012-07-18 18:02:22