Last active
January 22, 2019 10:08
-
-
Save Kameshwaran/33b2f1bc998686705c9c29f9dac7e680 to your computer and use it in GitHub Desktop.
Add/Update URL param and reload page
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
window.updateParamAndReload = function(paramName, value) { | |
var url = new URL(window.location.toString()) | |
url.searchParams.set(paramName, value) | |
window.location = url | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment