rkey

rkey

xhr送信リクエスト - サンプル

重要なコード:

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();
読み込み中...
文章は、創作者によって署名され、ブロックチェーンに安全に保存されています。