I don’t see your call to the ajaxurl in your code. Are you actually getting an ajax response?
Try this javascript:
jQuery(document).ready( function($) {
$("a.getviews").click( function() {
var td = $(this).parent();
/* only fetch results once */
$(this).unbind('click').bind('click', function(){return false;});
// replace button with loader
$(td).html('<span class="loader"></span>');
$.ajax({
type: 'POST',
url: ajaxurl,
data: { action: "get_views", tax_id: td.attr("id") },
success: function(response) {
$("td").html(response);
return false;
}
});
});
});
With large ajax responses I always have better luck buffering the output.
Add ob_start();
before your loop then at the end add:
$response = ob_get_contents();
ob_end_clean();
echo $response;
die(1);