求教,在creator中以如下方式获取到服务端反馈后,如何在另一个函数中访问response
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && (xhr.status >= 200 && xhr.status < 400)) {
var response = xhr.responseText;
console.log(response);
}
};
xhr.open(“GET”, url, true);
xhr.send();
回调…
2赞
请问这种情况回调怎么使用