> I'd want an AJAX call that only fired when there was no change after X
> seconds.
It's really not that hard... this is a rip-off of Prototype's form
observer. I still have no idea as to why you would need to use it -
unless you were submitting all the data back to the server every N
seconds, which I assume you are.
$.fn.observe = function( time, callback ){
return this.each(function(){
var form = this, change = false;
$(form.elements).change(function(){
change = true;
});
setInterval(function(){
if ( change ) callback.call( form );
change = false;
}, time * 1000);
});
};
With it you could hook it in to the forms plugin from SVN and
auto-save it to the server every N seconds.
$("#myForm").observe(5, function(){
$(this).ajaxSubmit();
});
--John
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/