Re: Ajax Broken w/ JS errors
I was having the same issue and found some information here: https://codex.wordpress.org/AJAX_in_Plugins.
I’m using BuddyPress, so I added the following to my functions.php file. If you are using regular WordPress I believe you’d need to substitute site_url(‘wp-load.php’) with admin_url(‘admin-ajax.php’):
function ajaxurl_fix () {
?>
<script> var ajaxurl = '<?php echo site_url('wp-load.php'); ?>';</script>
<?php
}
add_action( 'get_header', 'ajaxurl_fix');
Edit: I changed the action hook from init to get_header because I was experiencing problems logging in.