I know this has been asked a million times, but all I see is people explaining scope and no one explains a solution.
In this case HOW do I get alert to show the value of comment_count rather than undefined.
var comment_count;
$.post( "<?=site_url('comments/ajax_get_comment_count');?>",{tags:[aData[7],'BWQ']}, function( data ) {
comment_count = data;
});
alert(comment_count);