js 阻截alert对话框

js 拦截alert对话框script?var myAlertalert?window.alertfunction(msg){?????? ???//your code?????

js 拦截alert对话框

<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;方可实现拦截