调试代码导致IE出错的避免方法
代码如下: if(!window.console){ var names = [“log”, “debug”, “info”, “warn”, “error”, “assert”, “dir”, “dirxml”,”group”, “groupEnd”, “time”, “timeEnd”, “count”, “trace”, “profile”, “profileEnd”]; window.console = {}; for (var i = 0; i < names.length; i++){ window.console[names[i]] = function() {}; } }
用户评论