安卓/ PhoneGap的 - 的onClick()不工作 [英] Android/ Phonegap - onClick() not working

查看:133
本文介绍了安卓/ PhoneGap的 - 的onClick()不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PhoneGap的,我试图检测的onClick,但是在Android似乎完全地忽略它,下面就是我想:

I am using phonegap and am trying to detect the onClick, however the Android seems to completly ignore it, below is what I am trying:

<select name="func" onclick="StartButtons();" data-native-menu="true">

我已经试过onClick的几个变化包括JavaScript的,jQuery的等,但这些都不似乎工作。

I have tried several variations of the onClick include javascript, jQuery etc. however none of these seem to work.

我已经notcied说的onChange工作,然而这是没有多大用处给我,因为我需要用一个提示,询问用户是他们想改变,如果没有那么这个被忽略。但是,使用的onchange仍然保管箱内改变的项目。

I have notcied that onChange works, however this is not much use to me as I need use a prompt asking the user is they want to change, if it is no then this is ignored. However, using onchange still changes the item within the dropbox.

是否有人可以帮助呢?

感谢

推荐答案

我有同样的问题与jQuery,机器人似乎忽略JavaScript中的单击事件。本来,我的code与jQuery看起来是这样的:

I had the same problem with jQuery, Android seems to ignore the click event in javascript. Originally, my code with jQuery looks like this:

$("#element").click(function () { alert("message"); });

我不得不将其更改为:

I had to change it to:

$("#element").on("touchend", function () { alert("message"); });

不知道,如果你使用的是jQeury可言,但希望这有助于。

Not sure if you're using jQeury at all, but hope this helps.

这篇关于安卓/ PhoneGap的 - 的onClick()不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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