Skip to content

Commit

Permalink
enable prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
NehalAhmedQureshi committed Apr 20, 2024
1 parent 95f8d40 commit 92aa86c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
let main = 'https://api.aladhan.com/v1/calendarByAddress/2024/4?address='
let city = prompt('Enter city name to see prayer times!')

let concat = main + city
console.log(concat);

function api(){
fetch("https://api.aladhan.com/v1/calendarByAddress/2024/4?address=Pakistan")
fetch(concat)
.then( res => res.json())
.then ( data => console.log(data.data[10].timings))
.then(data => console.log(data.data[21].timings))
// namaz timings => data.data[10].timings
}

Expand Down

0 comments on commit 92aa86c

Please sign in to comment.