Debug iPhone Mobile Safari without Web Inspector
I found a way to do this. It's a little dirty but it works and it helps a lot with scripting for the browser.

Simply put a try...catch block around the code you're want to debug and use alert() to output the information to you. Like this:

try {
  // some code that might go wrong
catch (e) {
  alert(e);
  alert(e.stack);
}