📜  如何在 javascript 代码示例中访问 curl 数据

📅  最后修改于: 2022-03-11 15:02:20.445000             🧑  作者: Mango

代码示例2
var url = "www.yahoo.com";

var xhr = new XMLHttpRequest();
xhr.open("GET", url);

xhr.onreadystatechange = function () {
   if (xhr.readyState === 4) {
      console.log(xhr.status);
      console.log(xhr.responseText);
   }};

xhr.send();