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.

20 lines
418 B

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