function getQueryParameters(str) {
	  return (document.location.search)
      .replace(/(^\?)/,'') 
      .split("&")
      .reduce(function(p,n) {
        return n = n.split("="), p[n[0]] = n[1], p;
      }, {} );
}

console.log(getQueryParameters());



Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.