0

I've tried to only get "steamid" from AJAX(idk) link and I couldn't did it. Could you guys please help?

Link to find and get only "steamid" : here

I've tried this code:

    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 Answers1

0

Check this.

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

pixellab
  • 588
  • 3
  • 12
  • If the end-user isn't on the same domain as the request URL then they'll encounter a CORS error – Nick Parsons Feb 24 '19 at 10:46
  • Sure, but we can navigate to their domain and check the console right??? – pixellab Feb 24 '19 at 10:47
  • yeah, but if the OP was trying to use this code on their own server (ie not gamdom) then they'll encounter a CORS error like so: https://jsfiddle.net/ejs0byLc/3/ – Nick Parsons Feb 24 '19 at 10:55
  • 1
    use jsonp if poosible..https://stackoverflow.com/questions/18980841/how-to-call-ajax-request-with-json-response-using-jquery – pixellab Feb 24 '19 at 11:04
  • It worked. Thank you. How about getting someone's that we dont know his link. Like when the server sends new Request Method: GET with https://gamdom.com/user/blablabla.json ? – CanBeyNABDINIZ Feb 24 '19 at 11:07