Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/05/2014, 00:52
manelmanel8
 
Fecha de Ingreso: marzo-2012
Mensajes: 180
Antigüedad: 12 años, 1 mes
Puntos: 2
Volver a cargar web al introducir usuario

Tengo esta función que añade un usuario, luego más abajo tengo una tabla que muestra todos los usuarios y cuando apreto f5 aparece el nuevo usuario... como puedo hacer para que lo haga automáticamente?

Código:
            $(function() {
           //twitter bootstrap script
                   $("button#afegir").click(function(){
                        $.ajax({
                            type: "POST",
                            url: "registrar.php",
                            data: $('form.afegir').serialize(),
                            success: function(msg){
                                $("#form-afegir").modal('hide');	
                            },
                            error: function(){
                                alert("failure");
                            }
                        });
                   });
                   $("button#editar").click(function(){
                        $.ajax({
                            type: "POST",
                            url: "registrar.php",
                            data: $('form.editar').serialize(),
                            success: function(msg){
                                $("#form-editar").modal('hide');	
                            },
                            error: function(){
                                alert("failure");
                            }
                        });
                   });                   
           });
           </script>