I'm using link_to_remote to load and show a number of partials and am
looking for a way to prevent multiple clicks on the link. I tried
searching around, but couldn't really find anything. The way it is
set up now is that if a user double clicks fast enough, two ajax
requests are sent to the server and when both are loaded, things get
messed up. I'm looking for a good way to eliminate the possibility of
that second ajax request. Is that possible using link_to_remote?
This is one of my link_to_remotes:
I'm using link_to_remote to load and show a number of partials and am
looking for a way to prevent multiple clicks on the link. I tried
searching around, but couldn't really find anything. The way it is
set up now is that if a user double clicks fast enough, two ajax
requests are sent to the server and when both are loaded, things get
messed up. I'm looking for a good way to eliminate the possibility of
that second ajax request. Is that possible using link_to_remote?
This is one of my link_to_remotes:
Does anyone have any suggestions or see anything wrong? I am
wondering if it would be better to use onSuccess rather than
onComplete, but maybe not, b/c then if an ajax.request was
unsuccessful the making_ajax_request would be left as true and the
user would be unable to make another ajax request.