1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Running XenForo.Register on ajax loaded elements?

Discussion in 'XenForo Development Discussions' started by Jaxel, May 9, 2016.

  1. Jaxel

    Jaxel Well-Known Member

    I know I've solved this issue before... but its been so long since I did it, I completely forgot how...

    I am registering a call in jQuery:
    XenForo.register('.MultiMainer', 'XenForo.MultiMainer');
    Using some different code, I inserted a div into my page using AJAX. That new code has a MultiMainer class included with it. However, that class is not getting registered for the callback, since its being called in through AJAX after initial page load.

    How do I make it so that new AJAX inserted elements get applied to the existing registers?
  2. Chris D

    Chris D XenForo Developer Staff Member

  3. Jaxel

    Jaxel Well-Known Member

    Okay, I figured it out using the following code:

    Last edited: May 10, 2016

Share This Page