Created
January 21, 2013 17:02
-
-
Save daniyalzade/4587473 to your computer and use it in GitHub Desktop.
Get URL parameter in javascript
This file contains hidden or 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