I'm trying to pass a reference to a variable and then update the contents in javascript, is that possible? For example a simple (fail) example would be...
var globalVar = 2;
function storeThis ( target, value ) {
eval(target) = value;
}
storeThis( 'globalVar', 5);
alert('globalVar now equals ' + globalVar);
This of course doesn't work, can anyone help?