-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.html
44 lines (43 loc) · 1.65 KB
/
post.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TheGBO - Blog</title>
<link rel="stylesheet" href="assets/css/style.css">
<link rel="shortcut icon" href="assets/img/pfp.png" type="image/x-icon">
</head>
<body>
<script id="replace_with_navbar" src="assets/js/navbar.js"></script>
<main id="content-wrapper">
</main>
<script src="./assets/js/postapi.js"></script>
<script>
var query = window.location.search.substring(1);
function parse_query_string(query) {
var vars = query.split("&");
var query_string = {};
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
var key = decodeURIComponent(pair[0]);
var value = decodeURIComponent(pair[1]);
// If first entry with this name
if (typeof query_string[key] === "undefined") {
query_string[key] = decodeURIComponent(value);
// If second entry with this name
} else if (typeof query_string[key] === "string") {
var arr = [query_string[key], decodeURIComponent(value)];
query_string[key] = arr;
// If third or later entry with this name
} else {
query_string[key].push(decodeURIComponent(value));
}
}
return query_string;
}
var qs = parse_query_string(query);
fetchSinglePost(qs.id);
</script>
</body>
</html>