Im trying to reload a page after the response from the facebook api.
With the code below I update my database with the $.get(‘…. and if I set window.location.reload(); after the $ get, then it doesnt run the $ get, so the database is not updated? Without the window.location.reload it runs the $ get and updates the database.
function(response){
if (!response || response.error) {
alert('Error occured' +response.error);
} else {
$.get('updatefacebookpost.asp?gallerier_id=<%=gallerier_id%>&gallery_id='+gallery_id+'&facebookPhotoId=' + response.id);
alert('Posten is uploaded!\nPost IDnr: ' + response.id );
window.location.reload();
}
So how can I reload the page that sends the facebook post, after it gets its response?
Any input appreciated, thanks!
1 Answer