Javascript AJAX Click event sometimes not working

2019-08-28 05:26发布

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条回答
仙女界的扛把子
2楼-- · 2019-08-28 05:59

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.

查看更多
登录 后发表回答