search

Home  >  Q&A  >  body text

javascript - Jquery button binds ajax query event, how to optimize?

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.

PHPzPHPz2798 days ago412

reply all(4)I'll reply

  • 世界只因有你

    世界只因有你2017-05-16 13:00:36

    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

    reply
    0
  • 为情所困

    为情所困2017-05-16 13:00:36

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

    reply
    0
  • 阿神

    阿神2017-05-16 13:00:36

    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

    reply
    0
  • 迷茫

    迷茫2017-05-16 13:00:36

    Add a time lock

    reply
    0
  • Cancelreply