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
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
Excellent, works great without the hassle of the way i mentioned
before
If anyone's interested, be my guest
--
HTML
--
--
JavaScript
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,
4 matches
Mail list logo