The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Problem with AJAX-loaded JS content not rendering properly

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #149086

    I have a problem with a WordPress site I’m developing. The nav menu is loading the page content via AJAX.

    The problem is I find that if I load content via AJAX and if that content contains JS code, the JS will not run. I understand this is because something needs to trigger the code. I also understand that something like jQuery’s .ajaxComplete() might be the answer (or maybe a little PHP is the key). I just don’t know how to make it work generally with all the different apps/plugins out there.

    The specific plugin I’m struggling with is called RoyalSlider. I need to force it to initialize somehow. The plan is to create many different sliders for different pages so it’s important I find a general solution that will force this plugin to initialize. I hope you’ll be able to help. I hope the solution you provide will help me understand how to generally trigger JS code in AJAX loaded content.

    Loaded normally:

    Loaded via AJAX:

    Thank you for taking the time to read this!

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.