-
-
Save SlyDen/2115aaa8d1781c63c117172c9a1efc16 to your computer and use it in GitHub Desktop.
Get URL parameter in javascript
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
function getURLParameter(name) { | |
var val = (RegExp('[?|&]' + name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]; | |
return val ? decodeURI(val) : val; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment