You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
755 B

getnodes();
function getnodes() {
let promised = fetch(api_url + 'getnodes').
then(resp => resp.json()).
then(obj => {
document.getElementById('json').innerText = JSON.stringify(obj.api);
if (typeof(obj.api) != 'undefined') {
let list = '<ol>';
for (let node of obj.api) {
console.log('getnodes.node:',node);
let url = `http:/${node}/docs/chain.html`
list += `<li><a href="${url}">${node}</a></li>\n`
}
list += '</ol>';
document.getElementById('list').innerHTML = list;
}
return obj;
}).
catch(console.error);
promised.then(obj => { console.log('obj:',obj); return obj; });
}
// ----------------------------------------------------
console.log('nodes.js loaded');