Jquery AJAX function


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <input class="q" type="text" id="contenido" name="contenido" onKeyUp="lookup(this.value);">
  2.  
  3. function lookup(inputString){
  4. if (inputString.lenght==0){
  5. $('#div').hide();
  6. }else{
  7. $.post("rpc_contenido.php", {queryString:""+inputString+""},function(data){
  8. if(data.lenght>4){
  9. $(#div).show();
  10. $('#div2').html(data);
  11. }else{
  12. $(?#div').hide();
  13. }
  14. });
  15. }
  16. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.