17 lines
512 B
JavaScript
17 lines
512 B
JavaScript
var xhr = new XMLHttpRequest();
|
|
xhr.open("GET", 'http://10.1.100.17:8080/api/status');
|
|
|
|
//Send the proper header information along with the request
|
|
xhr.setRequestHeader("Content-Type", "application/json");
|
|
xhr.onreadystatechange = function(){ // Call a function when the state changes.
|
|
if(this.readyState === XMLHttpRequest.DONE && this.status === 200){
|
|
console.log("XMLHttpRequest: Ready state.");
|
|
}
|
|
}
|
|
|
|
xhr.send();
|
|
|
|
var meta = xhr.response();
|
|
|
|
document.getElementById('list').innerHTML = meta;
|