-2
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/。預檢反應無效(重定向) 請幫我...針對預檢的響應無效(重定向)錯誤發生
謝謝。這個問題只解決服務器端... ... - –