function GetRemoteUseragent() {
var xhr = new XMLHttpRequest();
xhr.open('GET', '//'+site+'/useragent.txt', true);
// xhr.responseType = 'text';
xhr.onload = function () {
if (xhr.readyState === xhr.DONE) {
if (xhr.status === 200) {
// console.log(xhr.response);
// console.log(xhr.responseText);
var aaaa=xhr.responseText;
return aaaa;
}
}
console.log();
};
xhr.send();
}
console.log(GetRemoteUseragent());为什么这样打印不出来这个txt的内容呢,我需要把内容接受回来使用。
难道return不是这么玩吗,不会js求大佬指正。







