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>
|
||||
<body>
|
||||
<div class="col">
|
||||
<span>I'm sorry, but...</span>
|
||||
<span>I'm sorry, <span id="name"></span> but...</span>
|
||||
<h1>You're Wrong</h1>
|
||||
</div>
|
||||
<script>
|
||||
const nameSpan = document.getElementById("name");
|
||||
|
||||
let name = (new URLSearchParams(window.location.search)).get("name");
|
||||
if (name) {
|
||||
nameSpan.innerHTML = name;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue