XenForo AJAX Tutorial

Hey Kier... is there a way to STOP the "_redirectMessage" from firing? I want the AJAX to fire, but I don't want a message informing of success. How can I do this?
 
Hello Kier or anyone else who can help.

I use the OverlayTrigger to load a form and on that form I use XenForo.ajax to submit the form so that I can update the html according to the response data. But the problem is how to close the overlay at the final step?

If that's not possible or too tricky, can you please advise alternate solution?
 
Hello Kier or anyone else who can help.

I use the OverlayTrigger to load a form and on that form I use XenForo.ajax to submit the form so that I can update the html according to the response data. But the problem is how to close the overlay at the final step?

If that's not possible or too tricky, can you please advise alternate solution?

Ah!! It's much easier than what I think, just use this code: $(".OverlayCloser").click()
 
@Kier this was an amazing tutorial for 1.5 really helped me achieve what I needed to. JUst wondering besides the XenForo marker being XF now, what else would change, is it still valid? Is this something that we can still leverage or has the JQuery implentation changed too much?

If you could please show us how to manage this again in 2.2 that would be amazing
 
@Kier this was an amazing tutorial for 1.5 really helped me achieve what I needed to. JUst wondering besides the XenForo marker being XF now, what else would change, is it still valid? Is this something that we can still leverage or has the JQuery implentation changed too much?

If you could please show us how to manage this again in 2.2 that would be amazing
There are quite a lot of syntactical changes to do this sort of thing with 2.x, but most of the principles are very similar.

For example, here's some XF 1.x style code to open a link in an overlay:
HTML:
<a href="{xen:link test/page}" class="OverlayTrigger">XF 1.x overlay</a>
and here's the same thing in XF 2.x style:
HTML:
<a href="{{ link('test/page') }}" data-xf-click="overlay">XF 2.x overlay</a>

There are quite a lot of community-sourced XF2 development tutorials posted here at xenforo.com, but I think we're going to cover some 2.x add-on development basics in a future episode of XenForo Insights, so keep an eye out for that.
 
There are quite a lot of syntactical changes to do this sort of thing with 2.x, but most of the principles are very similar.

For example, here's some XF 1.x style code to open a link in an overlay:
HTML:
<a href="{xen:link test/page}" class="OverlayTrigger">XF 1.x overlay</a>
and here's the same thing in XF 2.x style:
HTML:
<a href="{{ link('test/page') }}" data-xf-click="overlay">XF 2.x overlay</a>

There are quite a lot of community-sourced XF2 development tutorials posted here at xenforo.com, but I think we're going to cover some 2.x add-on development basics in a future episode of XenForo Insights, so keep an eye out for that.
Ok great I will try and see if I can doctor it over, just need t o build a simple widget that pages through sport match data, had it working in 1.5 but haven't updated it for 2 yet
 
Sorry for the bump, but since this seems to be down.. is there an alternative?

All I want is a button press (via JS) to lead to a PHP function being called to change a text-element dynamically..
 
Back
Top Bottom