-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtwisume.html
31 lines (31 loc) · 1.14 KB
/
twisume.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="src/css/twisume.css?date=2022071816">
</head>
<body>
<div id="img-wrapper">
<p id="title" class="title-text"></p>
<img src="src/image/blue_cat_icon.png" width="300" height="300" >
</div>
<script type="text/javascript">
window.onload = function(){
var title = document.getElementById("title");
// boxのテキストを変更する
title.innerHTML = getParam("title") ?? "クエリパラメータ(title)を付与するとここに入るよ";
};
function getParam(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
</script>
</body>
</html>