Could anyone tell me what is wrong with this code? :( function sendAjaxRequest(param,listener){ $.ajax({ type: "POST", dataType: "json", url: "index.php?page=ajax", data: param, success: function(data){ if(data.status==0){ $("#"+listener).trigger('trueSuccess',[data]); }else{ $("#"+listener).trigger('trueError',[data]); } }, error: function(){ data='An Unexpected error has occured. Please try again later.'; $("#"+listener).trigger('unexpectedError',[data]); } }); } success event trigger a few more seconds after the response is already received from the server.
1. response received + few more seconds before triggering success. this is the only time i encountered this one. some of my projects is not the same as this. But on my previous projects i did not put it in a function and not in a separate JS file. this is right here is on a different js file and within a function. Does it matter? Im really lost pls help website is http://creativouae.com/creativo_leave