ignore firebug console when not installed

后端 未结 9 1339
旧时难觅i
旧时难觅i 2021-02-02 04:15

I use Firebug\'s console.log() for debugging my website. If I try viewing my website in browsers without Firebug then I get a console is not defined er

9条回答
  •  情深已故
    2021-02-02 04:40

    Off the top of my head:

    if(!console)
    {
         console = {};
         console.log = function() { };
    }
    

提交回复
热议问题