Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Fiszh authored Sep 26, 2024
1 parent fe49ab3 commit 6de0c9a
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,14 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dynamic URL Path</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
margin-top: 50px;
}
h1 {
font-size: 3rem;
}
</style>
<title>Dynamic Path Display</title>
</head>
<body>
<h1 id="display"></h1>
<h1 id="content">Dynamic path content will appear here</h1>

<script>
// Get the current URL path
const path = window.location.pathname.substring(1); // Remove the leading "/"

// Display the path or default to "Hello"
document.getElementById('display').innerText = path || 'Hello';
const path = window.location.pathname.substring(1); // Get the dynamic part of the path
document.getElementById('content').innerText = path || 'Hello'; // Show the path or default to 'Hello'
</script>
</body>
</html>

0 comments on commit 6de0c9a

Please sign in to comment.