Jaxel
Well-known member
I hate JavaScript.
I've got my template here (links cut out to save space)
That hooks into my JavaScript:
I need to execute the link in the "if" statement in my JS. I then need to run some more scripts on success; and do not reload the page.
Where do I get started?
Technically, I guess this link should POST.
I've got my template here (links cut out to save space)
Code:
<div data-xf-init="atendo-rsvpmenu" data-occur="{$occur->occur_id}" data-state="{$rsvp->rsvp_state}">
<a href="{{ link(...) }}" class="menu-linkRow" data-state="y">{{ phrase('EWRatendo_going') }}</a>
<a href="{{ link(...) }}" class="menu-linkRow" data-state="m">{{ phrase('EWRatendo_interested') }}</a>
<a href="{{ link(...) }}" class="menu-linkRow" data-state="n">{{ phrase('EWRatendo_not_going') }}</a>
</div>
That hooks into my JavaScript:
Code:
EWRatendo.rsvpmenu = XF.Element.newHandler(
{
state: null,
init: function()
{
state = this.$target.data('state');
this.$target.on('click', '.menu-linkRow', $.proxy(this, 'click'));
},
click: function(e)
{
e.preventDefault();
if (state != $(e.currentTarget).data('state'))
{
}
},
});
I need to execute the link in the "if" statement in my JS. I then need to run some more scripts on success; and do not reload the page.
Where do I get started?
Technically, I guess this link should POST.
Last edited: