I need to do an asynchronous post to a server when someone on my site clicks a link. I tried the code below, but it doesn\'t seem to be doing the task on the server I want it to
You have to check the response to determine whether the post has been succeeded or not then you should go on.
$("#item").click(function (e) { e.preventDefault(); $.post(link_to_something, function() { window.location = $(this).attr('href'); }); });