-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtracking.html
More file actions
128 lines (103 loc) · 4.39 KB
/
Copy pathtracking.html
File metadata and controls
128 lines (103 loc) · 4.39 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<html>
<head>
<title>Tracking</title>
<!-- This code is needed for responsive design to work.
(Responsive design = make the website look good on
smaller screen sizes like a phone or a tablet). -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Load a font called Roboto from Google Fonts. -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
<!-- Here are the CSS files for this page. -->
<link rel="stylesheet" href="styles/shared/general.css">
<link rel="stylesheet" href="styles/shared/amazon-header.css">
<link rel="stylesheet" href="styles/pages/tracking.css">
</head>
<body>
<div class="amazon-header">
<div class="amazon-header-left-section">
<a href="amazon.html" class="header-link">
<img class="amazon-logo"
src="images/amazon-logo-white.png">
<img class="amazon-mobile-logo"
src="images/amazon-mobile-logo-white.png">
</a>
</div>
<div class="amazon-header-middle-section">
<input class="search-bar" type="text" placeholder="Search">
<button class="search-button">
<img class="search-icon" src="images/icons/search-icon.png">
</button>
</div>
<div class="amazon-header-right-section">
<a class="orders-link header-link" href="orders.html">
<span class="returns-text">Returns</span>
<span class="orders-text">& Orders</span>
</a>
<a class="cart-link header-link" href="checkout.html">
<img class="cart-icon" src="images/icons/cart-icon.png">
<div class="cart-quantity">3</div>
<div class="cart-text">Cart</div>
</a>
</div>
</div>
<div class="main">
<div class="order-tracking">
<a class="back-to-orders-link link-primary" href="orders.html">
View all orders
</a>
<div class="delivery-date">
Arriving on Monday, June 13
</div>
<div class="product-info">
Black and Gray Athletic Cotton Socks - 6 Pairs
</div>
<div class="product-info">
Quantity: 1
</div>
<img class="product-image" src="images/products/athletic-cotton-socks-6-pairs.jpg">
<div class="progress-labels-container">
<div class="progress-label">
Preparing
</div>
<div class="progress-label current-status">
Shipped
</div>
<div class="progress-label">
Delivered
</div>
</div>
<div class="progress-bar-container">
<div class="progress-bar"></div>
</div>
</div>
</div>
<script>
/*
URL parameters:
it lets us save data directly in the URL. we can save multiple datas. just give an amperson and the data.
to create a URL parameter after the URL write like:
?orderId=123
? = means we're adding URL parameter
orderId = its the property
123 = its the value
this sorta like an object like:
{
orderId: '123'
}
now we can use js to get the data out of the URL, for that we can use an built-in class called "URL()", lets generate an object:
const url = new URL(window.location.href);
"window.location.href" this will get the URL from browser window. so this URL class analyses the URL address we gave and breaks it down into different parts.
one of the part is URL parameters. to get the parameters we use a property ".searchParams". btw URL parameters is aka search parameters, coz they're used for features like youtube search.
const url = new URL(window.location.href);
url.searchParams.get('orderId');
".get()" will give us data as individual parameter. we should give the property name and it'll give us the data.
in youtube if we search something our search will get saved into the URL as parameters, if we search for something else our search will also saved as URL parameters, and we can go back and forth b/w the two.
*/
const url = new URL(window.location.href);
url.searchParams.get('orderId');
</script>
</body>
</html>