Running XenForo.Register on ajax loaded elements?

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:
Code:
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?
 
Okay, I figured it out using the following code:

Code:
$("#TabVideos").before(e.ajaxData.templateHtml).xfActivate();
XenForo.activate($(".sectionVideo"));
 
Last edited:
Back
Top Bottom