当前位置: 代码迷 >> JavaScript >> js 阻截alert对话框
  详细解决方案

js 阻截alert对话框

热度:130   发布时间:2013-01-23 10:44:49.0
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>

1 楼 aeolusj 昨天  
var myAlert=alert;改为var myAlert=window.alert;方可实现拦截
  相关解决方案