well, looking in your config.js file, I see the Init() function is what you are working with? ... next time try narrowing it down to 1 file?
Code:
menus[1].addItem("javascript:alert(location.getVar(my_url_var))", "", 22, "left", "Brand New", 0);
you pretty much just copied the code. the alert was used as an example, you were supposed to change it up for your script... unless you are saving 'my_url_var' with the value of your variable, that's just not going to work.
with this example,
index.php?p1=page1&p2=page2
to grab the 'p1' variable from the url query string, we would do...
Code:
var p1 = location.getVar("p1");
so, with having that in mind (and not using a declared variable as we did above),
Code:
menus[1].addItem(location.getVar("p1"), "", 22, "left", "Brand New", 0);
the above code would put 'page' into that menu item.
of course if we wanted to declare all the url variables ahead of time you need...
- know the list of variables you are expecting
- take a different approach for an unknown amount of variables
we can cover the 2nd approach later if need be, but to pre-define the variables (as in the url 'index.php?p1=page1&p2=page2') we would simply code:
Code:
var p1 = location.getVar("p1");
var p2 = location.getVar("p2");
and then simply use those in the addItem method.
Code:
menus[0].addItem(p1, yadda, yadda);
menus[0].addItem(p2, yadda, yadda);
REMEMBER, of course,
to declare the 'location.getVar' method somewhere in the scope of your script otherwise, you will get an error, 'no such property or method' or something like it.
here is the method once more...
Code:
location.getVar = function(get_var) {
var regexp = new RegExp(get_var +"=([^&.]+)", "i");
if (regexp.exec(unescape(this.href)))
return(RegExp.$1);
else
return(null);
}
hope that clears things up for ya.