How to avoid calling ajax method more than once?

I have a .NET application that provides access to methods located on handlers through AJAX calls. These AJAX calls are terminated, usually when the user clicks on certain buttons. My problem occurs when the user clicks the buttons more than once. This is a mess with the whole state of my facility.

How do you take care of this? I know that I can block the user until the first call is completed, but I would like to find a solution that will take care of this on the server side. Any idea?

Thank!

+3
source share
3 answers

, . jQuery, one() . true false . , ​​ true.

. , , . . , . Havoc .

+1

onclick, onclick handler, ajax setTimer true...

ajax , onclick.

+1

Use the jQuery blockUI plugin. when the user first clicks the button and then blocks the user page. After completing the user task, unlock the page.

Contact http://malsup.com/jquery/block/#

0
source

Source: https://habr.com/ru/post/1728902/


All Articles