javascript - Jquery button binds ajax query event, how to optimize?
PHPz
PHPz 2017-05-16 12:58:36
0
4
402

For example, limit the number of queries, limit the query interval, cache query results, etc. I have no experience in the specific method, so please give me some advice.

PHPz
PHPz

学习是最好的投资!

reply all(4)
世界只因有你

If you click a button to send ajax and limit the frequency of clicking the button, you can use 防抖动
Instance analysis of debouncing and throttling

为情所困

Make a timer. Click again if the time is less than the timer to cancel the last ajax sent.

阿神

The timer sets the click state of the button (clicking again within 3 seconds after clicking will have no effect), or define a state value and reset the state value when the callback is completed

迷茫

Add a time lock

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