Array values?

Hello, I am trying to figure out why I cannot display this array's values?

Uncaught TypeError: Cannot read property "1" of undefined.

*vbscript array*
<% rs2Array = rs2.GetRows %>

*javascript array*
var rs2Array = Array(<%=rs2Array %>);

Open in new window

Who is Participating?
Julian HansenCommented:
I don't think the author is mixing the two - using a vbscript to create a javascript but I think CD& has nailed it should be

var rs2Array = new Array(<%=rs2Array %>);

However, it also depends on what the rs2Array output looks like and from the post it looks like it is a recordset which means that you will probably need to iterate through the recordset and build the array initialisation string in a jscript compatible manner.

I am assuming this outputs something - what is the resulting output (not of the alert) of the actual underlying script?
vbscript and javascript are not interchangable.  In any case to declare the javascript you probably need to declare the object as new Array, not just Array.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.