javascript - When clicking a button to add content, if the network is stuck, clicking multiple times will add multiple content.
为情所困
为情所困 2017-05-19 10:10:22
0
2
532

When clicking the button to add content, if the network is stuck, clicking the button multiple times will send multiple requests and add multiple content. How should the front end handle it.

为情所困
为情所困

reply all(2)
Peter_Zhu
  1. Set the button to disabled when clicking send

  2. Send a request

  3. After requesting the callback (regardless of success or failure), set the button to be available

phpcn_u1582

Disable the button after clicking it, wait for the network to respond, and then undisable it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template