Skip to content

Instantly share code, notes, and snippets.

@kozo002
Created January 12, 2012 10:28
Show Gist options
  • Select an option

  • Save kozo002/1599750 to your computer and use it in GitHub Desktop.

Select an option

Save kozo002/1599750 to your computer and use it in GitHub Desktop.
want jQuery methods
(function($) {
$.extend({
log: function(arg) {
if (typeof console === 'undefined') {
var ID = 'jquery-console-view',
$console_view = $('#' + ID),
$log = $('<p></p>').text(arg);
if ($console_view.size() <= 0) {
$console_view = $('<div></div>').attr({id: ID}).appendTo('body');
}
$console_view.append($log);
} else {
console.log(arg);
}
}
});
$.fn.extend({
ch: function(expr) {
return this.children(expr);
}
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment