var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myObj = this.responseText;
var jsonPretty = JSON.stringify(JSON.parse(myObj),null,2);
document.getElementById("demo").innerHTML = jsonPretty;
}
};
xmlhttp.open("GET", "https://api.blockcypher.com/v1/btc/main", true);
xmlhttp.send();

var xmlhttp1 = new XMLHttpRequest();
xmlhttp1.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myObj = this.responseText;
var jsonPretty = JSON.stringify(JSON.parse(myObj),null,2);
document.getElementById("demo1").innerHTML = jsonPretty;
}
};
xmlhttp1.open("GET", "http://bitcoin.mubiz.com/info", true);
xmlhttp1.send();

var xmlhttp2 = new XMLHttpRequest();
xmlhttp2.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myObj = this.responseText;
var jsonPretty = JSON.stringify(JSON.parse(myObj),null,2);
document.getElementById("demo2").innerHTML = jsonPretty;
}
};
xmlhttp2.open("GET", "http://bitcoin.mubiz.com/blockchaininfo", true);
xmlhttp2.send();

var xmlhttp3 = new XMLHttpRequest();
xmlhttp3.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myObj = this.responseText;
var jsonPretty = JSON.stringify(JSON.parse(myObj),null,2);
document.getElementById("demo3").innerHTML = jsonPretty;
}
};
xmlhttp3.open("GET", "http://bitcoin.mubiz.com/mininginfo", true);
xmlhttp3.send();

var xmlhttp4 = new XMLHttpRequest();
xmlhttp4.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myObj = this.responseText;
var jsonPretty = JSON.stringify(JSON.parse(myObj),null,2);
document.getElementById("demo4").innerHTML = jsonPretty;
}
};
xmlhttp4.open("GET", "http://bitcoin.mubiz.com/peerinfo", true);
xmlhttp4.send();
@@ -1,1881 +1,423 @@
-var xmlhttp = new XMLHttpRequest();%0D%0Axmlhttp.onreadystatechange = function() %7B%0D%0Aif (this.readyState == 4 && this.status == 200) %7B%0D%0Avar myObj = this.responseText;%0D%0Avar jsonPretty = JSON.stringify(JSON.parse(myObj),null,2);%0D%0Adocument.getElementById(%22demo%22).innerHTML = jsonPretty;%0D%0A%7D%0D%0A%7D;%0D%0Axmlhttp.open(%22GET%22, %22https://api.blockcypher.com/v1/btc/main%22, true);%0D%0Axmlhttp.send();%0D%0A%0D%0Avar xmlhttp1 = new XMLHttpRequest();%0D%0Axmlhttp1.onreadystatechange = function() %7B%0D%0Aif (this.readyState == 4 && this.status == 200) %7B%0D%0Avar myObj = this.responseText;%0D%0Avar jsonPretty = JSON.stringify(JSON.parse(myObj),null,2);%0D%0Adocument.getElementById(%22demo1%22).innerHTML = jsonPretty;%0D%0A%7D%0D%0A%7D;%0D%0Axmlhttp1.open(%22GET%22, %22http://bitcoin.mubiz.com/info%22, true);%0D%0Axmlhttp1.send();%0D%0A%0D%0Avar xmlhttp2 = new XMLHttpRequest();%0D%0Axmlhttp2.onreadystatechange = function() %7B%0D%0Aif (this.readyState == 4 && this.status == 200) %7B%0D%0Avar myObj = this.responseText;%0D%0Avar jsonPretty = JSON.stringify(JSON.parse(myObj),null,2);%0D%0Adocument.getElementById(%22demo2%22).innerHTML = jsonPretty;%0D%0A%7D%0D%0A%7D;%0D%0Axmlhttp2.open(%22GET%22, %22http://bitcoin.mubiz.com/blockchaininfo%22, true);%0D%0Axmlhttp2.send();%0D%0A%0D%0Avar xmlhttp3 = new XMLHttpRequest();%0D%0Axmlhttp3.onreadystatechange = function() %7B%0D%0Aif (this.readyState == 4 && this.status == 200) %7B%0D%0Avar myObj = this.responseText;%0D%0Avar jsonPretty = JSON.stringify(JSON.parse(myObj),null,2);%0D%0Adocument.getElementById(%22demo3%22).innerHTML = jsonPretty;%0D%0A%7D%0D%0A%7D;%0D%0Axmlhttp3.open(%22GET%22, %22http://bitcoin.mubiz.com/mininginfo%22, true);%0D%0Axmlhttp3.send();%0D%0A%0D%0Avar xmlhttp4 = new XMLHttpRequest();%0D%0Axmlhttp4.onreadystatechange = function() %7B%0D%0Aif (this.readyState == 4 && this.status == 200) %7B%0D%0Avar myObj = this.responseText;%0D%0Avar jsonPretty = JSON.stringify(JSON.parse(myObj),null,2);%0D%0Adocument.getElementById(%22demo4%22).innerHTML = jsonPretty
+$(document).ready(function() %7B%0D%0A%09$.ajax(%7B%0D%0A%09%09url : %22https://api.blockcypher.com/v1/btc/main%22,%0D%0A%09%09dataType : %22json%22,%0D%0A%09%09contentType : %22application/json; charset=utf-8%22,%0D%0A%09%09type : %22GET%22,%0D%0A%09%09timeout:%09%225000%22,%0D%0A%09%09async : false,%0D%0A%0D%0A%09%09success : function(data) %7B%0D%0A%09%09%09$('#bitcoin_block_number').append(data.height);%0D%0A%09%09%7D,%0D%0A%0D%0A%09%09error : function(xhr, status, err) %7B%0D%0A%09%09%09$('#bitcoin_block_number').append(err+%22 N/A%22)
 ;%0D%0A
+%09%09
 %7D%0D%0A
-%7D;%0D%0Axmlhttp4.open(%22GET%22, %22http://bitcoin.mubiz.com/peerinfo%22, true);%0D%0Axmlhttp4.send();
+%09%7D);%0D%0A%7D);%0D%0A

Update custom.js