How to get parameters from query string with JavaScript

I don’t remember where I found this piece of code, but it works nice to get query string parameters 🙂

it works quite simple, first it grabs all data after the question mark in the url, then it splits this result on the & character and then it splits again on the equal character. The result of that exists out of two pieces, the first is the key and the second the value of that key.