(function() {
    var noop = function noop() {};
    var methods = [
        'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
        'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
        'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
        'timeStamp', 'trace', 'warn'
    ];
    var length = methods.length;
    var console = window.console || {};

    while (length--) {
        // Only stub undefined methods.
        console[methods[length]] = console[methods[length]] || noop;
    }
}());

 

HTML5 Boilerplate默认一个处理所有的console call的fallback。
以下摘自:https://github.com/h5bp/html5-boilerp...

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-27
猜你喜欢
  • 2021-06-12
  • 2022-12-23
  • 2021-05-23
  • 2022-12-23
  • 2021-08-07
  • 2021-03-30
  • 2021-10-02
相关资源
相似解决方案