Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GET parameters #17

Open
tracend opened this issue May 18, 2013 · 0 comments
Open

GET parameters #17

tracend opened this issue May 18, 2013 · 0 comments

Comments

@tracend
Copy link
Member

tracend commented May 18, 2013

Although there is a query parser already, consider a more straightforward way of reading the variables passed in the URL.

Something like:

var $_GET = {};

document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
    function decode(s) {
        return decodeURIComponent(s.split("+").join(" "));
    }
    $_GET[decode(arguments[1])] = decode(arguments[2]);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant