计算alert弹出框的次数

1 (function() {
2     var oldAlert = window.alert,
3         count = 0;
4     window.alert = function(a) {
5         count++;
6         oldAlert(a + "\n You've called alert " + count + " times now. Stop, it's evil!");
7     };})();alert("Hello World");

 

posted @ 2016-06-29 16:05  蛋Mrs炒饭  阅读(429)  评论(0编辑  收藏  举报