IE6 does not parse the loaded JavaScript file (Recaptcha hosted by Google)

99封情书 提交于 2019-12-06 00:10:28

Double check that your script's src in the page source isn't api.recaptcha.net (some libraries use that, I know the Java one I was using did). If it is, that gets forwarded to www.google.com/recaptcha/api, and that seems to cause issues with IE6. Once I switched to using www.google.com/recaptcha/api as the actual script src, IE6 was completely happy. Good luck!

I solved this problem by using the https call, as per this thread in reCaptcha's Google Group.

This is not a solve, just an workaround.

Request the first js file: http://www.google.com/recaptcha/api/challenge?k=the_key on the server site, and inject the first part of the script on the page directly:

var RecaptchaState = {
    site : 'xxxxxxxxxxxx',
    challenge : 'xxxxxxxxxxxxxxxxxxxxxxxxx',
    is_incorrect : false,
    programming_error : '',
    error_message : '',
    server : 'http://www.google.com/recaptcha/api/',
    timeout : 18000
};

Then, using the GetJavaScript function and/or JQuery.getScript() function to load the second script: http://www.google.com/recaptcha/api/js/recaptcha.js

This solution works for IE6 based on my test, and to make the server less load, I detect the user's browser at server end as well as client end to inject different logic.

I know this is dirty workaround, just in case this might help someone.

NOT ANSWER (or is it?):fo_Ok ie6. Seriously, forget it. Without this attitude ie6 will live forever. It is like ancient evil spirit which will be alive until someone believe in it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!