-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d4e114
commit ff55a04
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export function removeQueryParam(paramName) { | ||
// Get the current URL | ||
let currentUrl = window.location.href; | ||
|
||
// Create a URL object from the current URL | ||
let urlObj = new URL(currentUrl); | ||
|
||
// Remove the query parameter | ||
urlObj.searchParams.delete(paramName); | ||
|
||
// Get the resulting URL string, after the parameter removal | ||
let newUrl = urlObj.toString(); | ||
|
||
// Update the URL displayed in the browser without reloading the page | ||
history.replaceState({}, null, newUrl); | ||
} |
ff55a04
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
blot – ./astro
blot.hackclub.dev
blot-git-main.hackclub.dev