Last active
November 9, 2015 15:56
-
-
Save agkovalev/3021b54ba495ff9bb729 to your computer and use it in GitHub Desktop.
Get URL Variables (JS)
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
Requests = { | |
QueryString : function(item){ | |
var svalue = location.search.match(new RegExp("[\?\&]" + item + "=([^\&]*)(\&?)","i")); | |
return svalue ? svalue[1] : svalue; | |
} | |
} | |
//usage | |
Requests.QueryString("id"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment