Ver Mensaje Individual
  #7 (permalink)  
Antiguo 29/07/2014, 10:54
mikehove
 
Fecha de Ingreso: abril-2012
Ubicación: Argentina
Mensajes: 215
Antigüedad: 12 años
Puntos: 2
Respuesta: ¿Cómo ejecutar función php después de 2 segundos de haber cargado la págin

Hola Alexis.
Muy bien estuve probando tu guía y me sale hasta cierto punto, porque carga el primer "echo" que tiene un texto de prueba pero no el 2ndo. que es la función requerida.

add.php:


Código PHP:
echo "texto imprime bien";
echo 
recaptcha_get_html($publickey); 
js:

Código:
$(document).ready(function() {
    function recaptcha_get_html(){
        value = $('#value').text();
        $.ajax({
            type: "POST",
            url: "../content/add.php",            
	    async: false,
            success: function(data) {
                $('#value').text(data);
            }
        });
    }

    setTimeout(recaptcha_get_html, 3000);
});
html:

Cita:
<span id="value">
texto imprime bien
</span>

Última edición por mikehove; 29/07/2014 a las 11:16