Skip to:
Content
Pages
Categories
Search
Top
Bottom

Issue with Ajax Loaded Content and jQuery finctions

  • Avatar of stoi2m1
    stoi2m1
    Participant

    @stoi2m1

    I am having an issue with jQuery functions being applied to the Ajax loaded content via the Load More button at the bottom of the activity page. When I click on Load More a page full of posts are loaded but some of the applied jQuery which functioned when the initial page loaded is not being applied to the Ajax loaded content. One result is the comment forms are all hidden on page load, but when I click on Load More the comment forms within the newly loaded content are not hidden.

    I can see from the global.js file that this is a default feature within the default buddypress theme so I would expect things to function out of the box. I do not see any javascript errors in the firebug console.

    Jesse

Viewing 5 replies - 1 through 5 (of 5 total)
  • Avatar of henrywright
    henrywright
    Moderator

    @henrywright

    @stoi2m1 I’m not entirely understanding what you mean. Is the issue reported in this Trac ticket similar to your problem?

    https://buddypress.trac.wordpress.org/ticket/5329

    Avatar of stoi2m1
    stoi2m1
    Participant

    @stoi2m1

    @henrywright Not quit.

    In global.js there is a line at line 376 jq(‘form.ac-form’).hide();

    Which on page load hides all of the comment boxes.

    Now when I click on the load more button at the bottom of the page (or one of the .item-list-tabs) new or more Buddypress content is loaded. One of the issues I am having is the comment forms are not being hidden on this new or added content. It is some what a comment issue when not proper calling the .click() function and a .on() or .live() function should be used instead. I have tried a couple of things I have read about causes for Ajax loaded content which doesnt have the existing javascript in the page applied to the newly loaded content, but nothing has worked. So I figured this might be something specific to the Buddypress plugin or something commonly interfering with it.

    Avatar of henrywright
    henrywright
    Moderator

    @henrywright

    Right! I see exactly what you mean now. You can raise a bug report for issues such as this using the link provided in my last post.

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    I would try deactivating all plugins except BP and see if it works, this sounds like a javascript conflict.

    Avatar of stoi2m1
    stoi2m1
    Participant

    @stoi2m1

    @modemlooper I am very familiar with that process and even reverting back to default theme to ensure things are working well at the basic level. However I have quite a few dependencies within my theme which require various functions from various plugins. If I go through and disable plugins and or the mu folder the theme will hardly load.

    I could add a pile of if statements to ensure the plugins and/or functions are available, but is there another option to find if there is a javascript conflict? Like looking for multiple versions of jQuery being loaded or???

    Jesse

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.