What happened to console.log in IE8?

后端 未结 17 2946
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 04:45

According to this post it was in the beta, but it\'s not in the release?

17条回答
  •  余生分开走
    2020-11-22 05:48

    I like this method (using jquery's doc ready)... it lets you use console even in ie... only catch is that you need to reload the page if you open ie's dev tools after the page loads...

    it could be slicker by accounting for all the functions, but I only use log so this is what I do.

    //one last double check against stray console.logs
    $(document).ready(function (){
        try {
            console.log('testing for console in itcutils');
        } catch (e) {
            window.console = new (function (){ this.log = function (val) {
                //do nothing
            }})();
        }
    });
    

提交回复
热议问题