如何仅从AJAX中获取“ steamid”(或其他IDK)

时间:2019-02-24 10:33:47

标签: javascript ajax

我尝试仅从AJAX(idk)链接获取“ steamid”,但我做不到。你们能帮忙吗?

仅用于查找和获取“ steamid”的链接:here

我尝试了以下代码:

    var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() { 
    if (this.readyState == 4 && this.status == 200) {
 var ba =  this.responseText.split('\n'); var bubu = ba[ba.length-1]; console.log(ba); 
    }
  };
  xhttp.open("GET", "https://gamdom.com/user/%D0%BA%D1%94%CE%B7%CA%B8%E1%B5%98%E1%B6%A4%CB%A2%20gamdom.com.json", true);
  xhttp.send();

1 个答案:

答案 0 :(得分:0)

检查。

fetch('https://gamdom.com/user/%E2%9C%AA%20LocalRave%20Gamdom.com.json').then((response) => response.json()).then((data) => console.log(data.user.steamid))

enter image description here