test4 = () => {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
var xmlDoc1 = xhr.responseText;
console.log("?", xmlDoc1)
}
xhr.open("GET",'http://www.naver.com');
xhr.open("Access-Control-Allow-Origin",'http://www.naver.com');
xhr.send();
}
}
componentDidMount() {
this.test4()
}
错误==> XMLHttpRequest无法加载http://www.naver.com/。预检的响应无效(重定向) 请帮帮我......