JQuery get/ajax call executes callback without waiting for response
- by dannyroa
I'm having issues with my JQuery Ajax Call. The response is always null because the callback function is executed before the request to get_friends is completed. Is there anything I'm missing? Thanks in advance.
$('#btn_update').click(function() {
url = '/get_friends/';
$.get(url, {}, function(response){
alert(response);
});
});