Javascript AJAX Click event sometimes not working in Android native browser

两盒软妹~` 提交于 2020-01-06 08:30:07

问题


While testing my application with different devices I found one weird problem in android browser in android phones.

I have almost same design for PC and and mobile, in PC and in iPhone and mobile Chrome browser its working fine.

<a type="cart_type" onclick="ajax_submit_for_new_order_session(81, true); 
return false;" id="81" href="javascript:void(0)">
<i class="icon-plus-sign"></i></a>

Above is the code for my anchor tag, When I click on this anchor tag sometimes its calling the specified method and sometimes its not.

I am totally confused and scratching my head from so long for finding the issue but no luck.

Is there any problem with onclick in mobile devices?


回答1:


Solved the issue by updating the jQuery version to 1.11 earlier I am using 1.8

instead of using onclick now I am using touchstart or mousedown

this Solves the problem in all devices..

Its not problem with the code.. the delay taking by the browser is sometimes about 5 sec.



来源:https://stackoverflow.com/questions/21631597/javascript-ajax-click-event-sometimes-not-working-in-android-native-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!