How to deactivate console.log and alert?
<p>Being a newbie, I use console.log and alert() a lot in my attempt to learn JavaScript. I found a website that I was interested in and copied the html and javascript/jquery onto my local host to play around with it.  When I put console.log() and alert statements into the javascript to help figure it out, none of them worked. I tried this in multiple browsers (Chrome, Safari, Firefox), deleting browser history etc. There's nothing unusual looking about the code to me.  Is there something I might be missing?  The code is running fine (no errors being logged in the console). </p>

<p>As an aside, I copied it onto my local host because I didn't know how to add a console log in Firebug. Is there a way to do so?I get more information (that i understand) from console.log than setting a breakpoint. </p>

<p>Here's the code. It's obviously fairly straightforward (although I still need console.log to fully get it).</p>

<pre><code>// Global variables
var flag;
var dark;

$(document).ready(function() {
// $(function() {

    // Hide all closed sections
    $(".closed").next().hide();

    // Add slide functions to all sections (h1 elements)
    $("h1").click(function () {
        if($(this).is('.closed')) {
            $(".open").delay(200, function() { $(this).next().slideUp("slow"); });
            $(this).delay(200, function() { $(this).next().slideDown("slow"); });
            $("h1").deactivateElement();
            $(this).activateElement();
        }
        else if($(this).is('.open')) {
            $(this).delay(200, function() { $(this).next().slideUp("slow"); });
            $(this).deactivateElement();
        }
    });

    // Add a function to toggle the CSS styles
    $("a#style_switcher").click(function () { flag = !flag; dark.disabled = flag; });

    // Add hover functions to all sections (h1 elements)
    $("h1").hover(function() { $(this).addClass('hover'); }, function() { $(this).removeClass('hover'); });


    // Delay the call to (slide) functions
    // =&gt; http://james.padolsey.com/javascript/jquery-delay-plugin/
    $.fn.delay = function(time, callback) {
        jQuery.fx.step.delay = function() {};
        return this.animate( { delay: 1 }, time, callback);
    }

    // Set an element class to 'open' or 'closed'
    $.fn.activateElement = function() { switchClasses($(this), 'open', 'closed'); }
    $.fn.deactivateElement = function() { switchClasses($(this), 'closed', 'open'); }

    // Do this at start
     initialize(console.log("farting"));
      alert("hi");

    $(".who").delay(600, function() { $(this).next().slideDown("slow"); });
     $(".who").activateElement();
});


// Initialization function
function initialize () {
    flag = true;
    dark = document.getElementById("dark_css");
    dark.disabled = flag;



    // Set year in copyright section
    document.getElementById('year').innerHTML = (new Date()).getFullYear();
}

// Utility function for switching/toggling classes
function switchClasses (element, classToAdd, classToRemove) {



    element.addClass(classToAdd);
    element.removeClass(classToRemove);
    // De/Activate the given element
    (classToAdd == 'open') ? element.addClass('active') : element.removeClass('active');
}
</code></pre>
