¡@

Home 

2014/10/16 ¤W¤È 12:02:27

jquery Programming Glossary: checkinputvalue

How to run a function once when binding to multiple events that all trigger in Javascript?

http://stackoverflow.com/questions/13900093/how-to-run-a-function-once-when-binding-to-multiple-events-that-all-trigger-in-j

try to set up a value checking function like this var inputIntance #path to your input var lastInputValue function checkInputValue var newValue inputIntance.val if newValue lastInputValue make your AJAX call here lastInputValue newValue el inputIntance.closest.. update and then then fire this checks by any user action event you like inputIntance.on 'keyup change' function e checkInputValue or like this inputIntance.on 'keyup change' checkInputValue UPDATE there might be the case when you have to limit the number.. event you like inputIntance.on 'keyup change' function e checkInputValue or like this inputIntance.on 'keyup change' checkInputValue UPDATE there might be the case when you have to limit the number of AJAX requests per time. I added time control functionality..