I'm trying to post an array that gets modified in a local web page of 672 elements back to the server. For this I put it in a string, seperated by comma's, in a Javascript like this:
alert("begin");
var sBsbData=""
for (var x=0;x<24*4*7;x++)
sBsbData = sBsbData + BsbData[x] + ',';
alert(sBsbData);
BsbData is an array of int's; values don't exceed 10.
This is code that would get processed by any processor without a blink of an eye... yet it takes about ten seconds between the two alerts! What am I doing wrong here?? Did I pick a particularly bad concat method for this purpose?
BsbData.join(',')? But aside from that, the loop doesn't seem to take up any measurable time: jsfiddle.net/AUCWS.var sBsbData = BsbData.join(',');?var sBsbData = BsbData.toString(), and the format will be the same (values separated by commas).++xis slightly faster, but I don't think that's the problem.