Common idiom to avoid IE throw: Error: 'console' is undefined

前端 未结 2 1504
隐瞒了意图╮
隐瞒了意图╮ 2020-12-10 07:09

I\'ve installed firebug and I wrote all these log statements.

I\'ve tested my app in IE and of course I\'ve got \"undefined\" error.

What\'s the common id

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-10 08:08

    Paul Irish has a better wrapper for console.log().

    http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/

    This allows multiple arguments, and provides a history (for debugging) in case no console is there or (eg Firebug Lite) the console is created later.

提交回复
热议问题