确认和警告窗口重载后自动确认:
window.confirm =function(x) {console.log(x);return true;};
window.alert =function(msg){console.log(msg);return true;}
本文介绍了一种JavaScript技巧,通过重载window.confirm和window.alert方法实现自动确认及记录功能调用。此方法适用于测试环境,能够简化交互流程并方便开发者监控确认框和警告框的使用情况。
确认和警告窗口重载后自动确认:
window.confirm =function(x) {console.log(x);return true;};
window.alert =function(msg){console.log(msg);return true;}
1056

被折叠的 条评论
为什么被折叠?