Skip to content

Instantly share code, notes, and snippets.

Last active Sep 30, 2017
What would you like to do?
Get and Set URL parameter in javascript
<script type="text/javascript" src=""></script>
// Get the URL parameter
var argName = $.url().param('argName');
// Set the URL parameter
if (argName == null) {
history.pushState(null, null, '/?argName=defaultValue');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment