Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/17/2022 in all areas

  1. You need to append the input to the <form>, not the <body>.
    1 point
  2. Wrap your code in a single async function and call it. Then you can code in a more traditional style using await. When it comes time to do the "repeat every N time periods" part you can then pass that function to a call to setInterval. Example: function requests(url) { return fetch(url).then(function(response){ if (!response.ok) { throw new Error(`Request failed with status ${response.status}`) } return response.json(); }); } async function myExtension(){ const data = await requests('https://worker.mturk.com/projects.json'); for (let item of data.results[1]) { console.log(item); } } myExtension(); // When you're ready to repeat: //setInterval(myExtension, 5000);
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.