Use this, to cancel the default navigatin behavior of the <a>
:
$('#mybutton').click(function(e) { // <-- Add `e` here
e.preventDefault(); // <-- Add this line
var post_url = get_url();
var data = ...;
do_action(post_url, data);
});
I believe the AJAX request is being aborted by the browser because when clicking the link, although the request does get sent off, the link tries to navigate to a new page so the browser must abort open AJAX requests.