Last active
March 10, 2016 20:25
-
-
Save codingcarpenter/f98c4210e2e542e7b759 to your computer and use it in GitHub Desktop.
Gets named parameter from URL
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
Requests = { | |
QueryString: function(item) { | |
var svalue = location.search.match(new RegExp('[\?\&]' + 'searchTerm' + '=([^\&]*)(\&?)','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