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.

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.


source to share

1 answer

you have to use the click event, not click.

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



All Articles