ajax call after x characters

前端 未结 3 592
感动是毒
感动是毒 2021-01-21 01:42

I have an ajax call triggering on the maxlength of an input. However, it continues to trigger if a user continues to enter characters (because they count as a keypress). Is ther

3条回答
  •  伪装坚强ぢ
    2021-01-21 01:46

    Use a boolean variable to know if a call has already been triggered (init it to false, assert it is still false before making a call, and set it to true when you make the call).

提交回复
热议问题