:: Forum >>
Problem accessing a global array from
Hi all,
I am trying to use values of a global JS array (myCells) in the button.onClick function. However, the alert returns "[object]" instead of the array values "A", "B", "C". Therefore, I cannot use the array to do any further processing after the button is clicked.
The code is:
var myCells = new Array(''A", "B", "C")
var button1 = new AW.UI.Button;
button1.setId("button1");
button1.setControlText("Refresh quotes");
document.write(button1);
button1.onClick = function() {
alert(myCells);
};
Any idea, why I can't read the global array in the onClick function?
Thanks, Alexander
Alexander
Friday, July 9, 2010
Just replace:
var myCells = new Array(''A", "B", "C")
with:
var myCells = new Array("A", "B", "C")
(Note double quote char before A, instead of two single quote).
HTH
Saturday, July 10, 2010
This topic is archived.
Back to support forum
Forum search