Created
December 7, 2016 10:02
-
-
Save hoodasaad/b521ec5a0ade50156f0abc1de846df4f 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
var $_GET = {}; | |
document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () { | |
function decode(s) { | |
return decodeURIComponent(s.split("+").join(" ")); | |
} | |
$_GET[decode(arguments[1])] = decode(arguments[2]); | |
}); | |
You can now access the $_GET variables like so: | |
alert($_GET['some_variable']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment