PhoneGap的版本+ jquerymobile:对的onclick按钮不起作用 [英] PhoneGap build + jquerymobile: onclick on button does not work

查看:124
本文介绍了PhoneGap的版本+ jquerymobile:对的onclick按钮不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发使用jQuery Mobile的移动应用程序。在一个特定的网页我试着通过一个按钮一个onclick事件来调用javascript函数。

I developed a mobile application using jquery mobile. On a particular page I try to call a javascript function via a "onclick" on a button.

在线托管时,所有完美的作品在Safari浏览器在iPhone上。
http://laughlouder.onesixtydev.nl/star/batna.html

All works perfect in Safari on the iPhone when hosted online. http://laughlouder.onesixtydev.nl/star/batna.html

但是,当我通过建立PhoneGap的版本(在线)的应用程序,该按钮被冻结。
如果应用程序的构建的PhoneGap使用本网站观点相同的Safari浏览器林不知道。但是什么都我尝试,链接不会工作。

But when I build the app via PhoneGap build (online), the button is frozen. Im not sure if PhoneGap build of the app uses the same Safari browser for this web view. But what ever I try, the link wont work.

尝试这样做:
<输入类型=按钮值=保存的onclick =doSetItem();数据的ajax =false的>

和这样的:
< A HREF =#数据角色=按钮的onclickdoSetItem();>

这是在Safari的作品,而不是通过PhoneGap的构建奇怪的事情。有什么区别呢?

Strange thing that is works in Safari, but not via PhoneGap build. What is the difference anyway?

试图把文件准备功能,或在体内通过加载的onload这一切不会有所作为。谷歌搜索天,现在,似乎没有人有同样的问题。

Tried putting the function in document ready, or loading it via onload in the body all does not make a difference. Googling for days now, and nobody seems to have the same problem.

谁能提供帮助?
非常感谢。

Who can help? Thanks a lot.

推荐答案

你应该使用,而不是点击点击事件。

you should use tap event instead of click.

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

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

<一个href=\"http://www.bagonca.com/blog/2010/06/18/use-tap-events-instead-of-click-events-in-iphone-browser/\" rel=\"nofollow\">http://www.bagonca.com/blog/2010/06/18/use-tap-events-instead-of-click-events-in-iphone-browser/

这篇关于PhoneGap的版本+ jquerymobile:对的onclick按钮不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆