PhoneGap build + jquerymobile: onclick on button not working

I have developed a mobile app using jQuery mobile. On a specific page I am trying to call a javascript function using an onclick on a button.

Everything works fine in Safari on iPhone when posted online. http://laughlouder.onesixtydev.nl/star/batna.html

But when I build my app using PhoneGap build (online) the button is blocked. I'm not sure if in a PhoneGap app the app is using the same Safari browser for this web view. But what I am trying, the link is not working.

Tried this: <input type="button" value="Save" onclick="doSetItem();" data-ajax="false">

And this: <a href="#" data-role="button" onclick"doSetItem();">

Strange thing that works in Safari but not with the PhoneGap build. Who cares?

I tried to put the function in the document ready or load it through loading in the body, all this does not matter. Googling for days and no one seems to have the same problem.

Who can help? Many thanks.

+3


source to share


1 answer


you have to use the click event, not click.

 <a href="#" data-role="button" ontap"doSetItem();">

      



http://digitalize.ca/2010/02/jqtouch-tap-vs-click/

http://www.bagonca.com/blog/2010/06/18/use-tap-events-instead-of-click-events-in-iphone-browser/

0


source







All Articles