标签:
有如下数组
var infoArray = strTest.split(";");
var points2;
for (var i = 0; i < infoArray.length; i++) {
var info = infoArray[i];
points2 = info + "," + points2;
}
points2 = points2.substring(0, points2.length - 10);
var points3 = "[" + points2 + "]";
生成的数组JS获取报错,修改如下正常
var infoArray = strTest.split(";");
var str = "", points;
for (var i = 0; i < infoArray.length; i++) {
str += "," + infoArray[i];
}
points = eval("[" + str.substr(1) + "]");
标签:
原文地址:http://www.cnblogs.com/pp521/p/4644984.html