J
johkar
This is a bit tricky to describe, but here goes. Any help
appreciated. John
I declare multiple variables halfway down the page. The number
between "mech" and "Num" is generated dynamically in the XSL. Later
on I need to reference that variable in a function, but I need to
build the variable name in script. How do I convert it from a string
reference to a ref to the global variable?
function changePreference(pos,mt){
//mt does not reference mech2Num, I need it to.
}
changePreference(2,'my' + pos + 'Num');
var mech1Num=1|2|3|4|5|6;
var mech2Num=1|2|3|4|5|6;
var mech3Num=1|2|3|4|5|6;
appreciated. John
I declare multiple variables halfway down the page. The number
between "mech" and "Num" is generated dynamically in the XSL. Later
on I need to reference that variable in a function, but I need to
build the variable name in script. How do I convert it from a string
reference to a ref to the global variable?
function changePreference(pos,mt){
//mt does not reference mech2Num, I need it to.
}
changePreference(2,'my' + pos + 'Num');
var mech1Num=1|2|3|4|5|6;
var mech2Num=1|2|3|4|5|6;
var mech3Num=1|2|3|4|5|6;