Share Article To

Whenever we are loading any data in DOM through AJAX, these data are not registered into the DOM that is why jQuery code written for any event like click, change, submit etc for any element, are not fired.
Solution:
By defining those events in jQuery on or live function we can solve this problem. But if we are using any contribute js files then it is not possible for us to go through the code and define all the event in on or live functions.
So now the question is how we can solve this problem?
Solution is reload the corresponding js file again.

Solution for some particular cases using the AWS plug-in:

BuddyPress activity pages don’t load correctly

a) Open file ajaxify.js
b) Search for “$body.removeClass(‘loading’);”
c) Paste the below code just before this line
scriptNode = document.createElement(‘script’);
contentNode.appendChild(scriptNode);
scriptNode.setAttribute(‘src’, rootUrl + ‘wp-content/plugins/rehabtabs/js/rehabtabs.packed.js?ver=3.3.2’);

Page breaking in case of using ‘rehabtabs’ wordpress plug-in

a) Open file ajaxify.js
b) Search for “$body.removeClass(‘loading’);”
c) Paste the below code just before this line
scriptNode = document.createElement('script');
contentNode.appendChild(scriptNode);
scriptNode.setAttribute('src', rootUrl + 'wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js?ver=20120110');

5 thoughts on “My js events are not calling after loading the page using AJAX

  1. Hi there!

    This is a fantastic plugin!!
    I appreciate it very much 🙂

    Just one question..

    What if I want to call some library from my theme js folder?
    Could you explain how to?

    Thank you!!

  2. Hi,

    This worked for me, but I’d like to be able to do this without modifying the plugin core so that updates can be run.
    Is this possible?

    Thanks,
    Amy Mitchell

  3. Hey mate,

    Awesome plugin. Great job!

    Is there a known issue and solution for conflict between AWS and jquery collapse-o-matic? If I activate AWS, all my [expand] tags stop working.

    Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *