Hacker News new | ask | show | jobs
Show HN: Query-Params.js (github.com)
1 points by cjsturgess 2180 days ago
2 comments

I know it's not much, but I made a very small, simple tool that fetches the query parameters passed to a web page and makes them available under window.location.query. I found myself reusing this a lot for different projects and thought that I'd share. :)
Feel free to do with it whatever you'd like. I figured since it helps me out, it might help you out!
Does it support PHP query format?

foo[bar]=x&foo[bar]=y

It doesn't currently, but that's absolutely something I'll add.
Just updated to support arrays, so {foo[bar]: ["x", "y"]}. Working on splitting foo[bar] represent foo.bar