console.log 报错 uncaught typeerror illegal invocation
2012-06-18 12:22
525 查看
因为ie不支持console.log的原因 封装了一层 代码如下
function debug(){
window.console && console.log.apply(null , arguments);
}
FF下正常 chrome下把错uncaught typeerror illegal invocation
原因是console.log的运行上下文要求是console不能是其它任何别的object
修改代码为
window.console && console.log.apply(console , arguments);
function debug(){
window.console && console.log.apply(null , arguments);
}
FF下正常 chrome下把错uncaught typeerror illegal invocation
原因是console.log的运行上下文要求是console不能是其它任何别的object
console.info.call(this,"stuff") TypeError:Illegal invocation console.info.call(console,"stuff") stuff
修改代码为
window.console && console.log.apply(console , arguments);
相关文章推荐
- Uncaught TypeError: Illegal invocation
- Uncaught TypeError: Illegal invocation
- jquery 报 Uncaught TypeError: Illegal invocation
- Uncaught TypeError: Illegal invocation
- JQuery报错Uncaught TypeError: Illegal invocation的处理方法
- Uncaught TypeError: Illegal invocation
- jquery-1.9.1.min.js:69 Uncaught TypeError: Illegal invocation
- jQuery-2.1.4.min.js:4 Uncaught TypeError: Illegal invocation
- jS Ajax 上传文件报错"Uncaught TypeError: Illegal invocation"
- Uncaught TypeError:Illegal invocation
- JQuery报错"Uncaught TypeError: Illegal invocation"
- [Android] Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'
- 【Android】Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'
- android中java和JS互相调用,Web Console: Uncaught TypeError: Object [object Object] has no method
- [Android]通过js方法回调部分native报错 Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'
- [Android] Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'
- Android webview解决JS报错chromium: [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'getItem'
- [Android] Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'
- WebView注入Java对象注意事项 [INFO:CONSOLE(475)] "Uncaught TypeError: Object [object Object] has no method
- ajax请求报Uncaught TypeError: Illegal invocation错