juankennaugh
5/24/2013 - 1:32 PM

debugging - jquery method call context

debugging - jquery method call context

// src: http://ebobby.org/2013/05/18/Fun-with-Javascript-and-function-tracing.html?utm_source=javascriptweekly&utm_medium=email

$.fn.hide = (function() {             // Executed on the spot to create a closure.
    var oldfn = $.fn.hide;            // Save jQuery's hide().
    return function () {              // Create the closure and return the function to replace it.
        console.log(this);            // Simply print the context.
        oldfn.apply(this, arguments); // Apply jQuery's hide() so everything works normally.
    };
}());