Ver Mensaje Individual
  #13 (permalink)  
Antiguo 05/10/2012, 10:08
Avatar de satjaen
satjaen
 
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 11 años, 7 meses
Puntos: 10
Respuesta: Funcion Load cargar......

Probando he puesto este cod y funciona muy bien, pero yo solo quiero que se vea la imagen de loading, cuando se esten cargando o refrescando la pagina, entonces que debo de poner aquí:

Código Javascript:
Ver original
  1. $('#loading').html('<img id="loader" src="imagenes_menu/ajax-loader1.gif"/>');

Tengo que sustituir loading por otro div?
Alguna idea?

Código Javascript:
Ver original
  1. function filtrar()
  2. {  
  3.                 $.ajax({
  4.                     // Antes de realizar la llamada mostramos el ajax load
  5.                     beforeSend: function(){
  6.                         $('#loading').html('<img id="loader" src="imagenes_menu/ajax-loader1.gif"/>');
  7.                     },
  8.         data: $("#frm_filtro").serialize()+ordenar,
  9.         type: "POST",
  10.         dataType: "json",
  11.         url: "ajax.php?action=listar",
  12.             success: function(data){
  13.     var html_user ='' ;
  14.     if(data.length > 0){
  15.         $.each(data, function(i,item){
  16.        
  17.        
  18.          
  19.  html_user += '<tr ondblclick="pulsar(this, ' +  String.fromCharCode(39) + item.num_usuario + String.fromCharCode(39)  + ');" >';
  20.  html_user += '<td ><input name="demo" type="radio" value="' + item.num_usuario + '"/></td>';
  21.  html_user += '<td id="row0" >'+item.num_usuario+'</td>';
  22.  html_user += '<td>'+item.telefono+'</td>';
  23.  html_user += '<td>'+item.nombre+' '+item.apellidos+'</td>';
  24.  html_user += '<td>'+item.poblacion+'</td>';
  25.  html_user += '</tr>';
  26.            
  27.                                  
  28.         });                    
  29.     }
  30.     if(html_user == '') html_user = '<tr><td colspan="4" align="center">No se encontraron registros..</td></tr>';
  31.     $("#data tbody").html(html_user);
  32. }
  33.  
  34.            
  35.       });
  36. }

Última edición por satjaen; 05/10/2012 a las 12:21