I need to use jQuery to detect changes in a text file, so some ajax is called.
The trick is that I really don't want to bind this action to blurring or keyup events; The first is too deaf for the user, and the second is too "average": the user enters new keys before ending the ajax call, so the user interface is small (so the answer to this SO question is not applicable in my case).
I need a code that checks if a field value has changed, but periodically (i.e. every 0.5 seconds). I would like to use the same code in several fields, calling different ajax functions with different frequencies, so reuse here is really a plus.
In Rails, I had observe_field(internally uses Prototype Form.Element.observer , I think) that did just that. How can I accomplish the equivalent thing in jQuery?
source
share