Avoid console errors in browsers that lack a console | HTML5 boilerplate

there are lot of things we can pick it up from HTML5 boilerplate. One of the major findings I found from boilerplate is
How to avoid console errors on browsers that lacks console such as IE.

// Avoid `console` errors in browsers that lack a console.
(function() {
    var method;
    var noop = function () {};
    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 = window.console || {});

    while (length--) {
        method = methods[length];

        // Only stub undefined methods.
        if (!console[method]) {
            console[method] = noop;

// Place any jQuery/helper plugins in here.


I Am suresh(suresh kumar )a Web developer,Freelancer,webdesigner,UI developer from bangalore. Got 6+ yrs of IT experience . I specialize in standards-based XHTML, CSS and JavaScript web development. Each site I develop is built to be search engine friendly (SEO), using the latest development principles and techniques.

You may also like...

1 Response

  1. Hmm it appears like your blog ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say; I’m thoroughly enjoying your blog… I as well am an aspiring blog writer but I’m still new to the whole thing. Do you have any tips and hints for first-time blog writers??? I’d really appreciate it. Ajax Roofing Contractors, 15-75 Bayly St. W., #323, Ajax, Ontario, L1S 7L7, Canada, 289-275-1500

Leave a Reply

Your email address will not be published. Required fields are marked *