Does UIWebView support javascript-based double-click events?

Posted by Eric on Stack Overflow See other posts from Stack Overflow or by Eric
Published on 2010-04-06T05:09:07Z Indexed on 2010/04/06 5:13 UTC
Read the original article Hit count: 442

Filed under:
|
|

As usual, I'm trying to do something the easiest way possible, in this case implement a double-tap handler on a UIWebView like so:

<div id="foo" ondblclick="clickHandler(this);" ... >

It works fine in Safari and Firefox, and I know the code containing clickHandler is loading on the iPhone thanks to a now-annoying alert stmt at the end of loading.

If I change ondblclick to onclick it works on both the device and the simulator.

From reading similar queries it would seem that I need to intercept the taps in ... and then run my JavaScript code with the stringByEvaluatingJavaScriptFromString method, but then how do I know the JS id of the target? I no like that, would rather write a pure HTML/DOM/JS solution. Or since my app is about 80% web content, should I be using phonegap instead?

© Stack Overflow or respective owner

Related posts about uiwebview

Related posts about doubleclick