search.js 585 B

1234567891011121314151617181920212223242526
  1. $j(document).ready(function(){
  2. // console.log(linea);
  3. $j('#search').focus();
  4. //busqueda de items en la pestaña productos
  5. $j('#search').on('keyup', function(){
  6. var search = $j('#search').val()
  7. if (search != "") {
  8. $j.ajax({
  9. type: 'POST',
  10. url: 'shared/search.php',
  11. data: {'search': search},
  12. beforeSend: function(){
  13. $j('#result').html("<center><p><img src='media/img/loader.gif'/></p></center>")
  14. }
  15. })
  16. .done(function(resultado){
  17. $j('#result').html(resultado)
  18. })
  19. }
  20. else {
  21. $j("#result").load(" #ac")
  22. }
  23. })//termina #search
  24. })