ajax - jQuery form auto submission -


i trying write autosubmit form (similar google instant), , right using script so:

$(document).ready(function() {     $('#string').change(function(){         var url = $(this).val();         $('#area').load('cgi/test.pl',{string:url});     }); }); 

now problem after use finishes typing need click outside input field. have tried using onkeyup etc. instead of change firstly result in insane amount of requests, , secondly if paste text in field, won't work. have tried use javascript settimeout combination of script, couldn't working.

basically after autosubmission script 'detects' when user still typing (so kind of delay submission) , can detect when text has been pasted input field.

cheers suggestions.

i use dotimeout plugin implement "debouncing" (example: http://benalman.com/code/projects/jquery-dotimeout/examples/debouncing/).

this way, can use keyup. account users pasting text, keep change handler; invoke keyup handler when change fires.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -