`

js 拦截alert对话框

 
阅读更多


<input type="button" onclick="opened('ALERT')" value="提示"/>

<script>
 var myAlert=alert;
 window.alert=function(msg){      
   //your code        
  myAlert (msg+"-TEST");
 }
 function opened(msg){
  alert(msg);
 }
</script>

0
3
分享到:
评论
1 楼 aeolusj 2013-01-16  
var myAlert=alert;改为var myAlert=window.alert;方可实现拦截

相关推荐

Global site tag (gtag.js) - Google Analytics