安卓/ PhoneGap的 - 的onClick()不工作

安卓/ 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.