3.2.0

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
July 9,
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
July 10,

This topic is archived.

See also:


Back to support forum