J
Jeff
I have an event that I wish to pass a javascript array.
And I was thinking of using eval
onchange = "passArray('some_array')"
function passArray(arr){
var my_array = eval(arr);
....
I rarely use eval, is there a real downside to this? Eval routinely
gets savaged. This is server generated code and I would prefer not to
generate the array until below where the link is written. So if I did this:
(I think this is the right syntax)
onchange = "passArray("+some_array+")"
Then it wouldn't be defined yet.
Is there a better way to do this?
Jeff
And I was thinking of using eval
onchange = "passArray('some_array')"
function passArray(arr){
var my_array = eval(arr);
....
I rarely use eval, is there a real downside to this? Eval routinely
gets savaged. This is server generated code and I would prefer not to
generate the array until below where the link is written. So if I did this:
(I think this is the right syntax)
onchange = "passArray("+some_array+")"
Then it wouldn't be defined yet.
Is there a better way to do this?
Jeff