There are very elegant ways to do this. This is not one of them. This way works fine for me:
All this does is set an interval to execute every 100 milliseconds. It checks if the item exists (since the jQuery length function will return zero if it does not). If it does exist, it adds the jQuery event handler and removes the interval.var checkExist = setInterval(function() {if(jQuery("#someid").length) {jQuery("#someid").click( function() {// click handler code});clearInterval(checkExist);}}, 100);
No comments:
Post a Comment