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

This is a really strange problem, I'm trying to use Recaptcha on one of the websites, and it works for all tested browsers except IE6.

I made a link to google js:   http://www.google.com/recaptcha/api/challenge?k=the_key and it loads according to the fiddler2 file and the onreadystatechange event (which has readystate == 'loaded')

The normal workflow should be uploaded JS and another js is requested, then the image is uploaded from Google. my problem is the first JS file uploaded (content similar below):

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

document.write('<scr'+'ipt type="text/javascript" s'+'rc="' + RecaptchaState.server + 'js/recaptcha.js"></scr'+'ipt>');

not analyzed. Firstly, the following JS test:

 typeof RecaptchaState == 'undefined'

-, script ( fiddler2), recaptcha...

script , recaptcha, JS :

function GetJavaScript(url, callback) {
    var script = document.createElement('script');
    script.src = url;
    var head = document.getElementsByTagName('head')[0];
    var done = false;

    // Attach handlers for all browsers
    script.onload = script.onreadystatechange = function () {
        if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')) {
            done = true;
            callback();

            // remove the hanlder
            script.onload = script.onreadystatechange = null;
            head.removeChild(script);
        }
    };

    head.appendChild(script);
}

... : , . ( URL- , , JavaScript ...)

, , / ...

+3
4

, .

js: http://www.google.com/recaptcha/api/challenge?k=the_key - script :

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

, GetJavaScript / JQuery.getScript() script: http://www.google.com/recaptcha/api/js/recaptcha.js

IE6 , , , , .

, , -.

0

, script src api.recaptcha.net( , , , , ). , www.google.com/recaptcha/api, , , IE6. www.google.com/recaptcha/api script src, IE6 . !

+1

, https, reCaptcha Google Group.

+1

( ?): fo_Ok ie6. , . .. . , , - .

-1

Source: https://habr.com/ru/post/1755715/


All Articles