Hi,
I'm trying to passing a variable value to the array, it errors undefined. If I pass the same value explicitly then it works. Not sure what the problem is, can any one please help me on this?

part -1 (this works)
-------------------
var dbcountval=3;
for (var db2=0;db2<dbcountval;db2++)
{
var dbval=["13:52,2","14:52,4","15:52,20"];
var dbfinalval=dbval[db2];
document.getElementById("test_java").innerHTML=dbfinalval;
}

part -2 (this doesn't work)
-------------------------

var ReadVal=dbcpu(stime,etime);
//above function returns value like "13:52,2","14:52,4","15:52,20"
var dbval="[" + ReadVal + "]";
//dbval value is ["13:52,2","14:52,4","15:52,20"]
var dbcountval=3;

for (var db2=0;db2<dbcountval;db2++)
{
var dbfinalval=dbval[db2];
document.getElementById("test_java").innerHTML=dbfinalval;
}