This post is superceded now by Dan Stolls awesome post on a new inline function
There's not much to say about this post. I had been asked about pulling our Query String values from a Nintex Form.
var myVars = getQueryStringsIntoHashtable();
if(typeof myVars['name'] === 'undefined' || myVars['name'] == null)
// do something if the query string value is not found
var vars = , hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
hash = hashes[i].split('=');
vars[hash] = hash;
In the above example, I'm looking for a name,value pair where the name equals "name". If it finds it, it pops up an alert box with the value.
The getQueryStringsIntoHashtable function reads all the parameters from a Query String, splits them up and builds a hashtable (name,value pair).
So if you have a url like http://mycompany.com?x=1&y=2&name=LasVegas, you'll end up with a hashtable that looks like this :
x = 1
y = 2
name = LasVegas.
To access the values, you use the names. In my case, the function call result was stored in a variable (myVars). To access the "name" value, you simply do :