Foros del Web » Programando para Internet » Javascript » Frameworks JS »

ajax api recaptcha

Estas en el tema de ajax api recaptcha en el foro de Frameworks JS en Foros del Web. Hola: Al implementar recapatcha con ajax, llamando a la funcion verificar, siempre me da respuesta null el servidor recaptcha. Segun he leido es porque las ...
  #1 (permalink)  
Antiguo 06/10/2009, 10:59
 
Fecha de Ingreso: enero-2008
Mensajes: 303
Antigüedad: 16 años, 3 meses
Puntos: 0
ajax api recaptcha

Hola:
Al implementar recapatcha con ajax, llamando a la funcion verificar, siempre me da respuesta null el servidor recaptcha.
Segun he leido es porque las peticiones han de hacerse con XMLHttpRequest (publica), pero no tengo mucha idea de ajax y no se como hacerlo
¿podeís ayudarme?
Gracias y un saludo

Código HTML:
function nuevoAjax(){    
    var xmlhttp=false; 
    try     { 
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
    }
    catch(e)  { 
        try   { 
          
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
        } 
        catch(E) { xmlhttp=false; }
    }
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); } 

    return xmlhttp; 
}

  function showRecaptcha(element) {
          Recaptcha.create("6LcnqQ..................dwqXxLNg9", element, {
          theme : 'custom',
			lang: 'es',
            callback: Recaptcha.focus_response_field});
        }

  function verificar(date,res) {

if (!res) {
res = 'FAIL';
}
if(res== "true") {
document.getElementById('formulario').submit();
} else {


alert('Captcha not correct, please try again');

}
}

     </script> 
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:38.