Last active
February 22, 2018 12:14
-
-
Save aseredenko/a91beaf54aa0f2b128259e197887d81f to your computer and use it in GitHub Desktop.
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 gup( name, url ) { | |
if (!url) url = location.href; | |
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); | |
var regexS = "[\\?&]"+name+"=([^&#]*)"; | |
var regex = new RegExp( regexS ); | |
var results = regex.exec( url ); | |
return results == null ? null : results[1]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment