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.

22 lines
482 B

4 years ago
  1. var url = api_url + 'getblock'
  2. var elem = document.getElementsByTagName('div')[0];
  3. let button = document.getElementsByTagName('button')[0];
  4. let promised_peerid = fetch(url).
  5. then(resp => resp.json()).
  6. then(obj => {
  7. console.log('peerid.obj:',obj);
  8. let buf = elem.innerHTML;
  9. buf = buf.replace(':peerid',obj.peerid);
  10. buf = buf.replace(':name',obj.name);
  11. elem.innerHTML = buf;
  12. return obj
  13. }).
  14. catch(console.error);
  15. console.log('peerid.js loaded');