Commit 007a8205 authored by Mat's avatar Mat

ajax, récupérer le contenu json

parent 97bef39d
......@@ -32,6 +32,11 @@
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
console.log(this);
if (this.readyState === 4
&& (this.status === 200 || this.status === 0)) {
let json = JSON.parse(this.responseText);
console.log(json);
}
};
xhr.open('GET', ownersURL, true); // les données GET sont dans ownersURL
xhr.send(null); // les données POST seraient ici
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment