xhr.onreadystatechange = function()

in src/apache-unomi-tracker.js [722:741]


            xhr.onreadystatechange = function () {
                if (!requestExecuted) {
                    if (xhr.readyState === 4) {
                        if (xhr.status === 200 || xhr.status === 204 || xhr.status === 304) {
                            if (xhr.responseText != null) {
                                requestExecuted = true;
                                if (options.success) {
                                    options.success(xhr);
                                }
                            }
                        } else {
                            requestExecuted = true;
                            if (options.error) {
                                options.error(xhr);
                            }
                            console.error('[WEM] XML request error: ' + xhr.statusText + ' (' + xhr.status + ')');
                        }
                    }
                }
            };