var todayDate = new Date().toISOString().slice(0,10); var script = document.createElement('script'); script.src = 'https://s.w-x.co/staticmaps/wu/fee4c/surface_cur/watln/'+todayDate+'/1106z.jpg'; script.onload = function() { console.log(CorrectAnswer1[0]); } document.head.appendChild(script);