I am having a very similar issue. Two iphone 4 gives different results.
I wish I could provide some information that would help reproduce the problem but... I do not know why it's behaving like this.
I made a very simple html file based on the code provided by andrew.harland and I did not get the alert on my iPhone 4 but my friend was getting it.
I simply changed the <script> line to load the jquery from google hosted apis and I was able to get the alert.
It is worth to note that the local file came from the google hosted version.
|| ||Using local file (copy of google's)|| Referencing google's version directly||
||My iphone:||no alert||alert||
I tried multiple things like specifying the full URL on my local file and I tried specifying http: on the google one. Always same results.
I also cleared cache on my iphone and restarted it. Same results.