Skip to:
Content
Pages
Categories
Search
Top
Bottom

Ajax Broken w/ JS errors

  • @highexistence

    Participant

    All ajax functionality on single topic pages are broken. I get the following errors on:

    wp-lists.js:1 — Uncaught ReferenceError: ajaxurl is not defined

    topic.js:39 — Uncaught TypeError: Object [object Object] has no method ‘wpList’

    I’m using a copy of the TwentTen BBpress theme, but it doesn’t work even if I switch back to the default theme. I’m using the BBpress plugin with Buddypress, not standalone.

Viewing 10 replies - 1 through 10 (of 10 total)
  • @highexistence

    Participant

    Also I’m pretty sure that since this happened, my replies order has reverse with the most recent showing first. Weird…but hopefully that is a clue?

    @anointed

    Participant

    Are you running WordPress 3.2 or 3.3nightly?

    I’m running 3.3 and noticed this issue, but not sure when it first popped up.

    @highexistence

    Participant

    3.2.1 – It happened randomly to me as well

    @highexistence

    Participant

    I also switched back to the default buddypress theme and it still is broken. No JS errors, but no AJAX either

    @themefuist

    Member

    I noticed this a few weeks ago but never checked if it was fixed:

    https://bbpress.org/forums/topic/possible-bug-ajaxurl-for-favouritessubscribes#post-92000

    @highexistence

    Participant

    That fixes the first error but I’m still getting this one:

    topic.js:39Uncaught TypeError: Object #<Object> has no method ‘wpList’

    I’ve tried deactivating all plugins besides BBpress, switching to the default theme and re-installing BBpress. The errors still comes up.

    wplist.js is being called before topic.js so it must be something in the code…?

    @highexistence

    Participant

    Bump

    @highexistence

    Participant

    Anyone?

    @will_c

    Participant

    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.

    @highexistence

    Participant

    Thanks for the help @will_c!

    Unfortunately that didn’t work for me. Somehow I’m not even getting the above mentioned errors anymore (even before your suggestion) but AJAX is still not working.

    AJAX is broken in Buddypress and BBpress and I have tried deactivating all other plugins.

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Skip to toolbar