Thursday, 15 May 2014

javascript - jquery on() selector not working on mobile browsers/dynamically created content -



javascript - jquery on() selector not working on mobile browsers/dynamically created content -

i having problem jquery on selector. when using

$('.class').on("click",function(){ //code });

its working on mobile devices fails select dynamically created content changed

$( document ).on('click', '.class' ,function(){ //code });

now works dynamically created contents no longer supported on mobile browsers such opera mini or uc browser how can create work on conditions.

ok resolved of own:

add required code in function: , take variable temp store temporary boolean value

var temp=true; function function($this){ //code } $('.class').on("click",function(){ var $this = $(this); function($this); temp=false;//making temp false avoid re execution. }); $( document ).on('click', '.class' ,function(){ if(temp){ var $this = $(this); function($this); }else{ temp=true;//making temp true next event. } });

javascript jquery jquery-mobile

No comments:

Post a Comment