Hello guys. I haven't posted in a while but I ran into something interesting I thought I would share.

I have been working on some side projects messing around with mobile safari and I ran into a peculiar problem. I was binding the touchstart, touchmove and touchend events to a method and attempting to get the pageX and pageY from the targetTouches object but I kept getting undefined. For some reason targetTouches did not exist despite the fact that apple documented that it should exist in mobile safari events. As far as I'm aware there is no way to reproduce this on the desktop since there are no touch events and I have not seen a tool that matches firebug on the iPad this was a difficult issue to track down.

Well to make a long story slightly less long as it turns out the culprit was my good buddy jQuery. Despite my reading and re-reading the jQuery docs I could not find anywhere where this is documented but it looks like when I used jQuery to bind those events jQuery took the resulting event and created a w3c compliant event object and stuck the original event in the new event object. This is no doubt necessary and useful for removing odd browser quirks but it would have been really helpful to document this behavior somewhere.

So if your using jQuery and you need to get at that original event in all its mobile safari touchy goodness you will probably want to give the event object jQuery provides you one of these:

e = e.originalEvent;