rkey

rkey

xhr send request - example

Key code:

var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
    if (xhr.readyState === 4 && xhr.status === 200) {
        var response = JSON.parse(xhr.responseText);
        console.log(response);
    }
};

xhr.open('GET', 'http://192.168.0.109:5000/json', true);
xhr.send();

------
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
    if (xhr.readyState === 4 && xhr.status === 200) {
        var response = JSON.parse(xhr.responseText);
        console.log(response[0].name);
    }
};
  
xhr.open('GET', 'http://192.168.0.109:5000/json', true);  
xhr.send();
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.