Getting Firebug Lite working on iPhone Simulator (or, how to add a bookmark to Safari on the iPhone Simulator)

Jan 19 2011

I'm working on some javascript front-end code for one our clients and it's not working correctly on the "mobile" iPhone/iPad/iOS version of Safari.  Which is odd because it works fine on the "normal" versions of Safari (Mac and Windows).  Since I don't actually have an iPhone/iPad/iOS device, I'm limited to debugging the javascript on the iPhone Simulator but it shouldn't be a big deal (famous last words) since Safari has good javascript debugging tools (Develop -> Start Debugging Javascript).

So I fire up the iPhone Simulator and set the device hardware to be an iPad (more screen size is always better) and I turn on the javascript debugger (Settings -> Safari -> Developer -> Debug Console) and......all I get is a console log that shows output.  No debugger, no console, no resource loader, or anything else that is useful.  Yuk! 

How to create a verifiable URL

Jan 18 2011

As a user, there have been times where I have played with the URL querystring of a page to see what happens when I change the values of various parameters in it.  It can, at times, bring about unexpected and interesting results.  For example, if you are viewing a page with the URL of http://example.com/viewcustomer?id=1 wouldn't you be a bit curious what happens if you change that to read http://example.com/viewcustomer?id=10 ?  I know I would (and have...).  Depending on the coding behind the page, sometimes you get error pages or maybe you get to see data and/or results that you're probably not supposed to be seeing.

As a developer, sometimes you need to make absolutely sure the URL querystring that is being parsed by a page hasn't been changed at all.  This is especially true for scenarios like sending out links via email for password resets or automatic logins.  There is a very simple way to do that and over the years I've been surprised how many times I've had to teach other developers - Junior to Senior - this method.