1
我仍然在學習JavaScript的基礎知識,我試圖做一個簡單的GET HTTP請求從API返回的信息,但這個responseText將不會返回。下面的代碼:JavaScript的GET responseText的
var xhr = new XMLHttpRequest();
xhr.open('GET', "https://api.apithis.net/dictionary.php?define=hi", true);
xhr.send();
console.log(xhr.responseText)