add name as query parameter
This commit is contained in:
parent
b206caa7b7
commit
64e7876233
10
index.html
10
index.html
|
@ -33,8 +33,16 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<span>I'm sorry, but...</span>
|
<span>I'm sorry, <span id="name"></span> but...</span>
|
||||||
<h1>You're Wrong</h1>
|
<h1>You're Wrong</h1>
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
|
const nameSpan = document.getElementById("name");
|
||||||
|
|
||||||
|
let name = (new URLSearchParams(window.location.search)).get("name");
|
||||||
|
if (name) {
|
||||||
|
nameSpan.innerHTML = name;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue