XF.SomeEventHandlerName = XF.Click.newHandler({
eventNameSpace: 'XFSomeEventHandlerName',
init: function() { },
click: function(e) {
var el = this.$target,
config = {
method: 'GET',
action: [YOUR_URL_ENDPOINT],
successCallback: XF.proxy(this, 'processResponse'),
ajaxOptions: { skipDefault: true }
};
XF.ajax(
config.method,
config.action,
{},
config.successCallback,
config.ajaxOptions
);
},
processResponse: function(data) {
XF.setupHtmlInsert(data.html, function($html) {
$('.output-container').html($html);
});
}
});
XF.Click.register('xf-some-event-handler-name', 'XF.SomeEventHandlerName');