Parse Query String by pure JavaScrirpt

Here is a snipped I wrote today to parse Query String by pure JavaScript. Some people uses different JavaScript libraries. But from my older days when I used to parse GET parameter by perl I had a habit of writing this algorithm. I just translated it to JavaScript.

6 thoughts on “Parse Query String by pure JavaScrirpt”

I was looking for this just now. Good work.
I have googled it, went to stackoverflow, then to some other question on js. found went your profile and from there your blog and vola, last blog post is this one. WoW. this is cool.

Here is a snipped I wrote today to parse Query String by pure JavaScript. Some people uses different JavaScript libraries. But from my older days when I used to parse GET parameter by perl I had a habit of writing this algorithm. I just translated it to JavaScript.
Here goes the code.
[code language="javascript"]
function getUrlParts(url){