-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorderPlaced.html
84 lines (70 loc) · 2.69 KB
/
orderPlaced.html
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Order Placed Successfully Page</title>
<script src="https://kit.fontawesome.com/4a3b1f73a2.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
body {}
#orderContainer {
min-height: 80vh;
margin-left: 200px;
margin-right: 200px;
display: flex;
justify-content: center;
align-items: center;
}
</style>
</head>
<body>
<div id="navigation-placeholder"></div>
<br>
<div id="orderContainer">
<!-- <i style = "scale: 6; color: rgb(213, 126, 13);" class = "fa-regular fa-circle-check display:inline-block" ></i> -->
<h1 style= "display: block;"> Order Placed Successfully! </h1>
</div>
<div id="footer-placeholder"></div>
</body>
<script>
let array = [];
let emptyJSON = JSON.stringify(array);
localStorage.setItem('IDs', emptyJSON);
fetch('navigation.html')
.then(response => response.text())
.then(data => {
// Insert the navigation code into the placeholder div
document.getElementById('navigation-placeholder').innerHTML = data;
const parentContainer = document.getElementById('navigation-placeholder');
parentContainer.addEventListener('click', function (event) {
// Check if the clicked element matches the desired selector
if (event.target.matches('.button__badge')) {
// Handle the event for the dynamically created element
window.location.href = './cart.html'
}
});
const jsonArray = JSON.parse(localStorage.getItem('IDs'));
$('.button__badge').text(jsonArray.length)
console.log("navigation here..... " + jsonArray.lenght)
$('.website-name').click(function () {
window.location.href = "./home.html";
})
$('#openCart').click(function () {
window.location.href = "./cart.html"
})
$('#openCart').hide()
$('#search-button').on('click', function () {
if ($('#search-input').val()) {
window.location.href = "./search.html?search="+$('#search-input').val();
}
});
});
fetch('./footer.html')
.then(response => response.text())
.then(data => {
// Insert the navigation code into the placeholder div
document.getElementById('footer-placeholder').innerHTML = data;
});
</script>
</html>