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)