Created
May 16, 2017 10:45
-
-
Save qwersk/7f07150582fb522c0a2a1a89d00acf3c to your computer and use it in GitHub Desktop.
GET URL GET JAVASCRIPT JS
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
| function getURLParameter(name) { | |
| return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [null, ''])[1].replace(/\+/g, '%20')) || null; | |
| } | |
| myvar = getURLParameter('myvar'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment