/ Published in: JavaScript
url: http://www.example.com/?foo=bar
usage: $_GET['foo'] // 'bar'
Expand |
Embed | Plain Text
var $_GET = {}; document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () { function decode(s) { return decodeURIComponent(s.split("+").join(" ")); } $_GET[decode(arguments[1])] = decode(arguments[2]); });
You need to login to post a comment.
