-2

我正在使用 phonegap 构建服务制作移动应用程序。我已经在几台平板电脑和智能手机上测试了应用程序,它在除 Nexus 4 (android 4.4) 之外的所有设备上运行良好。在 Nexus 上,它不会调用以 html 编写的任何 onclick 属性中指定的函数。我的猜测是它必须对用户代理字符串做一些事情,所以我在 google chrome 模拟器中使用:

Mozilla/5.0 (Linux; Android 4.4; Nexus 4 Build/KRT16E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.105 Mobile Safari

http://user-agent-string.info/list-of-ua/os-detail?os=Android+4.4+KitKat上找到。

我无法复制该问题,但我确实使用 iPhone 5 中的 user-agent-string 再次找到了它:

Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53

我尝试谷歌搜索并没有找到任何有类似问题的人......

任何人都有任何想法可能是什么?

提前致谢!

4

1 回答 1

0

Ok, thanks to @Cerbrus, I wanted to make a test example for you guys to try. As I was unable to reproduce bug on simple html structure, i figured it had to do something with some of the libs I'm using. Turns out the problem was in iScroll lib, and after adding

tap: true

among other options, IT WORKED! Not sure why exactly did it happen but if someone has similar problem, add tap in options (NOT CLICK, as it wont work for android versions older than 4.4.4).

Thanks again

于 2014-10-17T15:24:07.157 回答