I was looking for a way to access querystring values with javascript.  I stumbled across a couple of articles that pointed me in the right driection, but unfortunately I forgot to book mark them.  I will try to find them again and provide a link to provide them the proper credit.  In the meantime here is the implementation:

var urlParams = {};
   (function () {
      var e,
      a = /\+/g, // Regex for replacing addition symbol with a space
      r = /([^&=]+)=?([^&]*)/g,
      d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
      q = window.location.search.substring(1);
      while (e = r.exec(q))
         urlParams[d(e[1])] = d(e[2]);
   })();

// You can reference the querystring value like so...
var variablename = urlParams["QUERYSTRINGNAME"];
Advertisements