[jQuery] Re: Threshold for saving content with AJAX

2007-05-14 Thread Fil
var notepad; function notepadSave() { notepad=setTimeout(function() { $.post("ajax.php",{ page: "notepad", notepad: encodeURI($('#notepad').val()) }); },3000); } I like this; but how do you program

[jQuery] Re: Threshold for saving content with AJAX

2007-05-14 Thread spinnach
just as a side note, to be totally unobtrusive and to separate your js from the rest of the content, you could do something like this: $(document).ready(function(){ $('#notepad').bind('keyup', notepadSave).bind('keydown', notepadClear); }); that way all your javascript stays in the js

[jQuery] Re: Threshold for saving content with AJAX

2007-05-13 Thread [EMAIL PROTECTED]
Excellent, works great without the hassle of the way i mentioned before If anyone's interested, be my guest -- HTML -- -- JavaScript

[jQuery] Re: Threshold for saving content with AJAX

2007-05-13 Thread spinnach
one way to do this would be with a timeout, although a bit different than you explained it.. start a timeout onkeyup, and clear it onkeydown, so after stopping typing the timeout won't be cleared and 5 seconds later the function will run.. dennis. [EMAIL PROTECTED] wrote: Confusing title,