Reputation: 11342
I'm trying to get rid of the save buttons on my websites.
I know the most obvious way would be to do a jQuery onChange
event. But it seems like it's going to be a lot of queries on the server.
I also thought about doing onBlur
, but that would mean the user needs to click somewhere else before loading a new page, and if he forgets, the changes will be lost.
Is there any other more efficient way?
For example, what does Asana use?
Upvotes: 2
Views: 128
Reputation: 43168
You should use debouncing, so that you only make your AJAX call after a brief period of inactivity. Here is the Underscore.js implementation: http://underscorejs.org/#debounce
Upvotes: 4