McM
mcm@noway.es
Contact me: noway.es
Contact me

Solution to Recaptcha explorer incompatibility

I was trying to implementing a recaptcha solution for a web page when I discover an error we the explorer:

"Cannot open internet site - Operation aborted"

This problem is also referenced here

The error occurs with internet explorer 6 and 7. It seems that recaptcha is incompatible for explorer, working fine with firefox but here I present a trick to solve this problem.

The solution consists on delaying the load of the javascript function which creates the recaptcha. A function in reacaptcha.js called create:

<script type="text/javascript" src="recaptcha.js"></script>

<script>
function display_Recaptcha( myObject ) {
    Recaptcha.create( "<recaptcha key ....>", myObject, { theme: "red",tabindex: 0, callback: Recaptcha.focus_response_field });

}
function reload_Recaptcha() {
Recaptcha.reload();
setTimeout( "change_Recaptcha()", 100);
}
function change_Recaptcha() {
var aux = document.getElementById('recaptcha_response_field');
aux.className = 'captchaInput';
}
</script>

<script>
try{
setTimeout( "display_Recaptcha( 'myObject' )", 5000 );
setTimeout( "reload_Recaptcha()", 6000 );
}
catch(Error){
setTimeout( "display_Recaptcha( 'myObject' )", 5000 );
setTimeout( "reload_Recaptcha()", 6000 );
}
</script>

where myObject is the id of a div where I display an animated gif while waiting for captcha:

<div id='myObject'>
<img width="310" height="130" src='reloj-de-arena-roto.gif'/>
</div>

reloj-de-arena-roto.gif is a simple image displayed while loading captcha.

This solution seems to solve the imcompatibility with explorer of the implementation http://recaptcha.net/.

Share it!

Twitter Gmail Delicious Google Bookmarks Hotmail Yahoo Mail Share/Bookmark