Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm using the following code to call a couple of functions which do ajax post. I found by not using data.preventDefault the functions seem to get triggered multiple times so I used data.preventDefault which fixed this. I just can't work out how to update the links once the functions have run.
$(document).bind('flagGlobalBeforeLinkUpdate', function(event, data) {
if (data.flagName == 'event_attend' && data.flagStatus == 'flagged') {
data.preventDefault = true;
postAttend();
}
if (data.flagName == 'event_attend' && data.flagStatus == 'unflagged') {
data.preventDefault = true;
postNotattend();
}
});
Comments
Comment #1
joachim CreditAttribution: joachim commentedClosing support requests older than a year. Feel free to reopen if this is still relevant.