diff --git a/app.js b/app.js index 3a0706d..fccb249 100644 --- a/app.js +++ b/app.js @@ -1,3 +1,8 @@ -function getTimes(city, countryCode){ - +async function getTimes(city, countryCode){ + console.log("Starting . . .") + const response = await fetch(`http://api.aladhan.com/v1/timingsByCity?city=${city}&country=${countryCode}`) + const parsedResponse = await response.json(); + console.log(parsedResponse.data.timings) } + +document.getElementById("getTimes").onclick = ()=> getTimes(city.value, code.value)