`

IE FF Chrome浏览器离开弹窗提示

    博客分类:
  • js
阅读更多

//--------------离开提示---------------------	
	window.onbeforeunload = function(e){
		if(window.navigator.userAgent.indexOf("Chrome") !== -1 ){
			return '提示!';
		}
		if ( e && e.preventDefault ){
			e.preventDefault();
		}else{
        		window.event.returnValue = '';
		}
	}
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics