(function(context,$) { context.JK = {} var console_methods = [ 'log', 'debug', 'info', 'warn', 'error', 'assert', 'clear', 'dir', 'dirxml', 'trace', 'group', 'groupCollapsed', 'groupEnd', 'time', 'timeEnd', 'timeStamp', 'profile', 'profileEnd', 'count', 'exception', 'table' ]; if ('undefined' === typeof(context.console)) { context.console = {}; $.each(console_methods, function(index, value) { context.console[value] = $.noop; }); } context.JK.logger = context.console; $(function() { $('a.confirm').click(function() { return confirm('ARE YOU SURE?!'); }) }) })(window, jQuery);