Created
September 28, 2020 15:38
-
-
Save binarymax/fd285281a5741b729489c81538bc3ee3 to your computer and use it in GitHub Desktop.
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
//---------------------------------------------------------- | |
//Gets the querystring value for the specified key | |
$.querystring = (function(key,url){ | |
url = url || window.location.search; | |
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); | |
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)"); | |
var results = regex.exec( url ); | |
return (!results)?"":decodeURIComponent(results[1].replace(/\+/g, " ")); | |
}).bind($); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment