Ver Mensaje Individual
  #6 (permalink)  
Antiguo 15/05/2013, 00:44
Avatar de madman_18
madman_18
 
Fecha de Ingreso: agosto-2010
Mensajes: 792
Antigüedad: 13 años, 8 meses
Puntos: 14
Respuesta: Insertar elementos jQuery Mobile

Cita:
Iniciado por diurno10 Ver Mensaje
estas utilizando el .trigger('create') ?
ej:

$('div.tb-turnos-res').html(data).trigger('create');
Ahora que me lo mencionas sí, ya que no conocía esa propiedad

Pero.... me ocurre un problema... después de hacer ese data quiero ocultar el loading, y me muestra en algunos casos que el objeto $.mobile no está definido...
Pongo el código por si hay alguna errata o hay una mejor manera de ponerlo
Código Javascript:
Ver original
  1. $("#seleccion_menu article ul li a").click(function(){
  2.                        
  3.                        var elemento = 'accion='+this.name;
  4.                        $.mobile.loading('show',{
  5.                          text: 'Cargando...',
  6.                          textVisible: true,
  7.                          theme: 'a'
  8.                        });
  9.                        
  10.                        setTimeout(function(){
  11.                            $.ajax({
  12.                                type:'post',
  13.                                url:'ajax.php',
  14.                                data: elemento,
  15.                                success: function(data){
  16.                                    $('#contenido').html(data).trigger('create');
  17.                                    $.mobile.loading('hide');
  18.                                    $("#mi_menu").panel('close');
  19.                                }
  20.                            });
__________________
"Si consigues ser algo más que un hombre, si te entregas a un ideal, te convertes en algo muy diferente"