-
Notifications
You must be signed in to change notification settings - Fork 0
/
save.html
127 lines (121 loc) · 4.68 KB
/
save.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
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
<!DOCTYPE html>
<html>
<head>
<title>
Burnout Cars
</title>
<script type="text/javascript">
var urlString = window.location.href;
var url = new URL(urlString);
var make = url.searchParams.get("make");
var model = url.searchParams.get("model");
var year = url.searchParams.get("year");
</script>
<link rel="stylesheet" type="text/css" href="style.css" title="css_style">
</head>
<body>
<div class="save_card">
<h1>Recent Car Details</h1>
<h2>Seller Details:</h2>
<table align="center">
<tr>
<td>
<strong>Seller Name :</strong>
</td>
<td>
<label id="lblSellerName"></label>
</td>
</tr>
<tr>
<td>
<strong>Address :</strong>
</td>
<td>
<label id="lblAddress"></label>
</td>
</tr>
<tr>
<td>
<strong>City :</strong>
</td>
<td>
<label id="lblCity"></label>
</td>
</tr>
<tr>
<td>
<strong>Phone Number :</strong>
</td>
<td>
<label id="lblPhoneNumber"></label>
</td>
</tr>
<tr>
<td>
<strong>Email Address :</strong>
</td>
<td>
<label id="lblEmailAddress"></label>
</td>
</tr>
</table>
<h2>Vehicle Details:</h2>
<table align="center">
<tr>
<td>
<strong>Make :</strong>
</td>
<td>
<label id="lblMake"></label>
</td>
</tr>
<tr>
<td>
<strong>Model :</strong>
</td>
<td>
<label id="lblModel"></label>
</td>
</tr>
<tr>
<td>
<strong>Year :</strong>
</td>
<td>
<label id="lblYear"></label>
</td>
</tr>
</table>
<a href="index.html">Home</a>
<a href="" id="jdlink" target="_blank">Jd Power Link</a>
<a href="new.html" target="_self">Add New Record</a>
</div>
<script>
document.getElementById('lblSellerName').innerHTML=url.searchParams.get("sellername");
document.getElementById('lblAddress').innerHTML=url.searchParams.get("address");
document.getElementById('lblCity').innerHTML=url.searchParams.get("city");
document.getElementById('lblPhoneNumber').innerHTML=url.searchParams.get("phonenumber");
document.getElementById('lblEmailAddress').innerHTML=url.searchParams.get("emailaddress");
document.getElementById('lblMake').innerHTML=url.searchParams.get("vehiclemake");
document.getElementById('lblModel').innerHTML=url.searchParams.get("vehiclemodel");
document.getElementById('lblYear').innerHTML=url.searchParams.get("vehicleyear");
var pairs = location.search.slice(1).split('&');
var result = {};
pairs.forEach(function(pair) {
pair = pair.split('=');
result[pair[0]] = decodeURIComponent(pair[1] || '');
});
var Item=JSON.stringify(result);
var Items=[];
if(localStorage.getItem('Items')==null){
localStorage.setItem('Items',JSON.stringify(Items));
}else{
Items=JSON.parse(localStorage.getItem('Items'));
Items.push(Item);
localStorage.setItem('Items',JSON.stringify(Items));
}
var link = document.getElementById('jdlink');
link.setAttribute('href',"https://www.jdpower.com/cars/"+url.searchParams.get("vehicleyear")+"/"+url.searchParams.get("vehiclemake")+"/"+url.searchParams.get("vehiclemodel"));
</script>
</body>
</html>