Not sure at which point you are struggling with in the mentioned tutorial since you did not provide your snippet, but checking that article out, I was able to craft a fully working example for you (with some improvement suggestions in the comments). Observe the following...
function QueryStringToJSON(str) {
var pairs = str.split('&');
var result = {};
pairs.forEach(function (pair) {
pair = pair.split('=');
var name = pair[0]
var value = pair[1]
if (name.length)
if (result[name] !== undefined) {
if (!result[name].push) {
result[name] = [result[name]];
}
result[name].push(value || '');
} else {
result[name] = value || '';
}
});
return (result);
}
var string = 'var1=5&var2=stackoverflow&var3=blah';
var obj = QueryStringToJSON(string);
console.log(obj) // {var1: "5", var2: "stackoverflow", var3: "blah"}
JSFiddle Link - working demo
Searching around on the web will point you to jQuery BBQ: $.deparam as an approach to this at some point. This is great, and probably a bit more robust, but you should be able to get away with the above code first, especially if you desire a vanilla solution (which you always should!!)