'beforeunload' Chrome Issue

前端 未结 6 1940
不思量自难忘°
不思量自难忘° 2021-02-07 08:40

I have this simple piece of code -

$(window).bind(\'beforeunload\', function(){
    alert(\"Good Bye\")
});

Works great with Firefox, IE8 but

6条回答
  •  悲&欢浪女
    2021-02-07 08:50

    I had to include it in a jQuery(document).ready to get it working in chrome

    
    

提交回复
热议问题