Hi,
I have a javascript function that reads in an array from php. Each record is split by a $ and each field is then split by a ^. I was wondering if anyone could help me get this data into a 2d array? Heres what I have so far.
This gives me the results for the first record
I have a javascript function that reads in an array from php. Each record is split by a $ and each field is then split by a ^. I was wondering if anyone could help me get this data into a 2d array? Heres what I have so far.
Code:
function drawExisting() {
if (request.readyState ==4) {
var returned = request.responseText;
var recordSplit = returned.split("$");
var record = recordSplit[0];
alert(record);
var fieldSplit = record.split("^");
var object_name = fieldSplit[0];
var xpos = fieldSplit[1];
var ypos = fieldSplit[2];
var height = fieldSplit[3];
var width = fieldSplit[4];
// alert(object_name + " " + xpos + " " + ypos + " " + height + " " + width);
}
}
Comment