JOEHEWITT.COM

Thoughts on software and life.

Friday June 29

iPhone JavaScript Experiments: Day One

I've never waited in line for a gadget before. Heck, I've never waited in line for just about anything except maybe lunch back in high school. Today I was walking through the Valley Fair Mall, just there to buy myself a nice new shirt, and oh, hey, is that Steve Wozniak sitting on that bench? Oh yes, the iPhone goes on sale today! 4 hours of standing in line later and I am now an iPhone owner. I didn't really need a new shirt after all.

I have one reason only to own this phone, which is to figure out inner workings of mobile Safari and start making some kick-ass mobile software. I've been experimenting with it for the last half hour, and I'm a bit frustrated. If Apple is serious about the iPhone being a platform for rich web development, my initial JavaScript experiments show they have a ways to go.

My first task has been exploring the DOM events that you can handle. I am hoping to write a little multi-touch interactive app, so I'm particular interested in mouse events. Sadly, there seems to be no way to react to the user touching the screen. You do not get a "mousedown" event when your finger touches the screen, instead you get "mousedown" and "mouseup" at the same time when you release your finger. The "mousemove" event does not seem to fire at all. There is no way to handle double-clicking either. A double-click zooms in and out, and event.preventDefault() doesn't override that behavior as it should.

I'm waiting for my commentary from the Webkit team on this - hopefully there are workarounds.

at
Posting your comment. Please Wait...