Jump to content

Create variables from URL variable passing


Darkmatter5

Recommended Posts

function getURLVar(varName) {
  url = unescape(self.document.location);
  if (varstring = url.substring(url.indexOf('?')+1)) {
    varpairs  = varstring.split(/&/);
    for (i=0; i<varpairs.length; i++) {
      varpair = varpairs[i].split(/=/);
      if (varName==varpair[0]) { return varpair[1]; }
    }
  }
  return false;
}

var cab_id  = getURLVar(cab);
var fol_id  = getURLVar(fol);
var item_id = getURLVar(item);

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.