Posted By

marcio on 01/25/10


Tagged

javascript debug jquery log


Versions (?)

Debug crossbrowser


 / Published in: jQuery
 

  1. //para debugear con mensajes
  2. $.log = function(message) {
  3. if(window.console) {
  4. console.debug(message);
  5. } else {
  6. alert(message);
  7. }
  8. };
  9.  
  10. //para hacer un alert del objeto
  11. $.fn.debug = function() {
  12. return this.each(function(){
  13. if(window.console) {
  14. console.debug(this);
  15. } else {
  16. alert(this);
  17. }
  18. });
  19. };

Report this snippet  

You need to login to post a comment.