Created
April 7, 2014 09:25
-
-
Save jjmu15/10017223 to your computer and use it in GitHub Desktop.
js get url paramter
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 urlParam(name){ | |
var results = new RegExp("[\\?&]" + name + "=([^&#]*)").exec(window.location.href); | |
if(results) { | |
return results[1]; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment