Created
August 27, 2020 14:11
-
-
Save spjeff/4943f9ac761bc5b8f3fd626a001efede 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
// from https://stackoverflow.com/questions/827368/using-the-get-parameter-of-a-url-in-javascript | |
function gup( name ){ | |
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); | |
var regexS = "[\\?&]"+name+"=([^&#]*)"; | |
var regex = new RegExp( regexS ); | |
var results = regex.exec( window.location.href ); | |
if( results == null ) | |
return ""; | |
else | |
return results[1]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment