Javascript best practice: handling Firebug-specific code

前端 未结 9 783
春和景丽
春和景丽 2021-02-03 10:31

Firebug is certainly a wonderful tool for javascript debugging; I use console.log() extensively.

I wanted to know if I can leave the Firebug-specific code in production.

9条回答
  •  走了就别回头了
    2021-02-03 11:07

    If you leave console.log() calls in your production code, then people visiting the site using Internet Explorer will have JavaScript errors. If those people have extra debugging tools configured, then they will see nasty dialog boxes or popups.

    A quick search revealed this thread discussing methods to detect if the Firebug console exists: http://www.nabble.com/Re:-detect-firebug-existance-td19610337.html

提交回复
热议问题