-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript1.js
More file actions
28 lines (26 loc) · 838 Bytes
/
script1.js
File metadata and controls
28 lines (26 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var api='https://www.anapioficeandfire.com/api/books?page=1&pageSize=40'
// var api="https://www.anapioficeandfire.com/api/characters?page=1&pageSize=40"
async function ice(){
try{
var data_fetch=await fetch(api)
var final_out=data_fetch.json()
var end_result=await final_out
console.log(end_result)
for(let i of end_result){
var a=i.aliases
document.querySelector(".class").innerHTML=`${"a"}
// var c= document.createElement("br")
// document.querySelector("body"). append(c)
}}
catch(error){
console.error(error)
console.log(error)
}
}
ice()
for(let i of end_result){
var a=i.name
var b=document.createElement('p')
b.setAttribute('p',a)
document.querySelector("body").append(a)
}}