Return to Snippet

Revision: 49284
at July 19, 2011 04:05 by relish


Initial Code
var $_GET = {};
document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
    function decode(s) {
        return decodeURIComponent(s.split("+").join(" "));
    }
 
    $_GET[decode(arguments[1])] = decode(arguments[2]);
});

Initial URL

                                

Initial Description

                                

Initial Title
grab GET vars in Javascript

Initial Tags

                                

Initial Language
JavaScript