$( "#inputString" ).bind( 'keyup', function() { if( $( this ).val().length > 3 ) { setTimeout( "pesquisa()" , 3000 ); } }); function pesquisa(inputString) { if( inputString == null ) { inputString = $( "#inputString" ).val(); } if(inputString.length == 0) { $('#suggestions').fadeOut(); // Hide the suggestions box } else { if( inputString.length > 3 ) { $.get("/produtos/autocompletar/"+ inputString +"/limit:5", function(data) { // Do an AJAX call $('#suggestions').fadeIn(); // Show the suggestions box $('#suggestions').html(data); // Fill the suggestions box }); } } }
Alguém tem uma sugestão pra resolver isso?
Falopa!
Edição feita por: hostdesigner, 21/09/2009, 10:03.