Now remove venda= []; and instead of venda.push(vendreq.responseText); use venda = vendreq.responseText.split("+++"); That'll create an array of your returned string as "VNAME1,VCODE1","VNAME2,VCODE2"...