Debugging Javascript in Safari

I was talking iPhone webapps last night with some other developers & the discussion turned to Javascript debugging. Thanksfully, most mobile web apps don’t use a lot of javascript (mainly because they should be simple apps & mobile devices don’t have the horsepower to do tons of javascript). But still, I rooted around and this post from Christopher Hill about enabling javascript debugging in Safari with Drosera. However, it only works in the Mac version of Safari, and you should grab the nightly build to boot.

If you’re testing on Windows, you can get by with Firebug/Firefox for heavy & initial debugging, and then using Safari’s Developer tools (enabled in the Preferences->Advanced dialog) and Safari’s javascript console to echo out debug statements using javascript code like this:

if(window.console) {
        window.console.log("some debugging text");
    }
0