2

The html page goes like this: <body onclick="doSomething();">...</body>

It works fine in chrome or firefox, yet no response in UIWebView of iOS.Is it banned by Apple or something? Or if there any way to work around it?

Carusd Ray
  • 993
  • 7
  • 11

1 Answers1

5

Try this:

<body ontouchend="doSomething();">

Reference:
[1] Event handling documentation.
[2] Does UIGestureRecognizer work on a UIWebView?

Community
  • 1
  • 1
eternity
  • 473
  • 5
  • 8
  • Important for my case: I need to have my element include onclick="void(0)" so that the UIWebView knows that the element is clickable at all. – treejanitor Nov 25 '13 at 11:43