Hacker Newsnew | past | comments | ask | show | jobs | submit | btraut's commentslogin

So this is why PSN was hacked? Were the user passwords also served to users in plain-text and evaluated in Javascript?


The other <pre> and print_r()-based solutions don't work quite as well when you're writing an AJAX-based app. I use error_log for everything:

  // PHP error_log() wrapper
  function el($var, $die = true) {
     error_log(var_export($var, true));
  
     if ($die) {
        die();
     }
  }
Also, Paul Irish's Javascript log() function is amazing. It can be found in boiler plate, but here's the gist:

  // Javascript console.log() wrapper
  window.log = function() {
     log.history = log.history || [];
     log.history.push(arguments);
  
     if (this.console) {
        console.log(Array.prototype.slice.call(arguments));
     }
  };


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: