Any Javascript experts here?

I'm trying to grab a variable from the URL and then use that variable within Squiffy.

Grabbing the variable from the URL is actually quite easy. Say my URL is

I can use the following code in my main HTML document to grab the name:

function getQueryVariable(variable)
   var query =;
   var vars = query.split("&");
   for (var i=0;i<vars.length;i++) {
           var pair = vars[i].split("=");
           if(pair[0] == variable){return pair[1];}

var myurldata = getQueryVariable("name");


My JS name variable now = john.

However. I'm struggling to actually use this within Squiffy. I tried to actually run the code within Squiffy, rather than locating it in my HTML document, but it doesn't seem to work.

Any advice?

Silly me, I forgot about the way JS declares global and local variables. All is fixed now.

This topic is now closed. Topics are closed after 60 days of inactivity.