We've just released arg.js, a project aimed at solving this problem once and for all. It's traditionally been so difficult but now you can do:
var name = Arg.get("name");
or getting the whole lot:
var params = Arg.all();
and if you care about the difference between ?query=true
and #hash=true
then you can use the Arg.query()
and Arg.hash()
methods.