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

Extend Xenforo.Ajax

#1
I have a simple question,

I am passing back a new variable in all ajax json calls and added the new column "_visitor_messagesUnread".

All ajax calls that update the conversations and alerts has this new field.

{"templateHtml":"","css":"","js":"","_visitor_conversationsUnread":"4","_visitor_alertsUnread":"0","_visitor_messagesUnread":0}

I then want to update XenForo.balloonCounterUpdate for this section (in this case groups)


Other then editing js/xenforo/xenforo.js, is there a way to extend or overwrite xenforo.ajax so i can add my custom code for the necessary call backs & updates?

Thanks gents
 

Mike

XenForo developer
Staff member
#2
We trigger a XFAjaxSuccess event on the document which should have the data you need passed into it.