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
751 B

3 years ago
  1. testing();
  2. function testing() {
  3. let promised = fetch(api_url + 'getnodes').
  4. then(resp => resp.json()).
  5. then(obj => {
  6. document.getElementById('json').innerText = JSON.stringify(obj.api);
  7. if (typeof(obj.api) != 'undefined') {
  8. let list = '<ol>';
  9. for (let item of obj.api) {
  10. console.log('test.item:',item);
  11. let url = api_url + `getcas?addr=${item}`;
  12. list += `<li><a href="${url}">${item}</a></li>\n`
  13. }
  14. list += '</ol>';
  15. document.getElementById('list').innerHTML = list;
  16. }
  17. return obj;
  18. }).
  19. catch(console.error);
  20. promised.then(obj => { console.log('obj:',obj); return obj; });
  21. }
  22. // ----------------------------------------------------
  23. console.log('txpool.js loaded');