Home >Web Front-end >JS Tutorial >How to avoid IE errors caused by debugging code_javascript skills

How to avoid IE errors caused by debugging code_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 16:53:331038browse
Copy code The code is as follows:

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() {};
}
}

can be placed in the basic library. Of course, pay attention to the scope of names and i ~
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn