-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmyOrder.js
51 lines (40 loc) · 1.35 KB
/
myOrder.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// This page will provide js for the myOrder.js
let myOrder = JSON.parse(localStorage.getItem("myOrder"))||[];
if(myOrder!=[]){
append(myOrder)
}
function append (data){
let container= document.getElementById("myOrdercontainer");
container.innerHTML=null
data.forEach(ele => {
div=document.createElement("div")
div.setAttribute("class","pdiv")
img=document.createElement("img")
img.src=ele.api_featured_image
img.setAttribute("class","image")
p=document.createElement("p")
p.innerText=ele.name
p2=document.createElement("h4")
p2.innerText="Order Completed"
div.append(img,p,p2)
container.append(div)
});
}
//
//
//ele.name
//ele.api_featured_image
// let myOrder=JSON.parse(localStorage.getItem("userData"))||[]
// let obj =[{name:"Maskara",
// api_featured_image: "https://files.myglamm.com/site-images/400x400/OTTP-(1).jpg",
// }]
// localStorage.setItem("myOrder",JSON.stringify(obj))
compl=()=>{
append(myOrder)
}
live =()=>{
let container= document.getElementById("myOrdercontainer").innerText=`There are no orders, We have some recommended product for you click !`
}
cncl =()=>{
let container= document.getElementById("myOrdercontainer").innerText="There are no orders, We have some recommended product for you click !"
}