Comments on: Debugging with $.log() or log() https://j11y.io/snippets/debugging-with-log-or-log/ Sun, 22 Mar 2015 15:39:22 +0000 hourly 1 https://wordpress.org/?v=5.0.13 By: Paul Irish https://j11y.io/snippets/debugging-with-log-or-log/#comment-345 Wed, 31 Dec 2008 23:52:24 +0000 https://j11y.io/?p=309#comment-345 James,

Great posts lately.

I was using a similar script (with console.log.apply), but saw that Safari and Chrome’s consoles don’t play nicely with it.

This seemed to be an ugly but functional cross browser solution:

window.debug = function(q,w,e,r,t,y){  
  try { console && console.log && console.log.apply(console,arguments); } 
  catch(e){ console && console.log && console.log(q,w,e,r,t,y); }
}
]]>
By: James https://j11y.io/snippets/debugging-with-log-or-log/#comment-344 Wed, 31 Dec 2008 11:46:34 +0000 https://j11y.io/?p=309#comment-344 @Balazs, good point, just changed it. 🙂

]]>
By: Balazs Endresz https://j11y.io/snippets/debugging-with-log-or-log/#comment-343 Wed, 31 Dec 2008 10:59:40 +0000 https://j11y.io/?p=309#comment-343 Hey, why are you using an internal undocumented object to store data? You can store the log on the $.log function itself!

$.log = $.fn.log = function(o) {
  //...
  $.log.cache[$.log.cache.length] = arguments.length > 1 ? arguments : o || this;
}
 
$.log.cache=[];

Anyway, some useful stuff again!

]]>
By: Joe McCann https://j11y.io/snippets/debugging-with-log-or-log/#comment-342 Tue, 30 Dec 2008 22:21:37 +0000 https://j11y.io/?p=309#comment-342 Nice, will be using this instead of my own lil snippet while developing jQuery plugins.

]]>