I have a problem with my Ajax call. In success function, I want to trigger a click on a element but it doesn't fire.
Here is the code :
$.ajax({
url : '/test/'+clubID,
beforeSend:function(){
$.mobile.showPageLoadingMsg();
},
complete:function(){
$.mobile.hidePageLoadingMsg();
},
success:function(data, textStatus, jqXHR){
if(!jQuery.isEmptyObject(data)) {
$('#camera-input').click();
console.log($('#camera-input'));
console.log('click');
} else {
toast('Il est possible de prendre des photos uniquement lors d\'une soirée');
console.log('toast');
}
}
});
The console print click and the element. Any ideas about the problem ?
Thanks for your help