Binding Ajax response to jquery nested array -
i'm trying bind ajax response jquery nested array (arrays inside main array). example explanation of requirement
ajax response : {1,2,3,4,5,6,7,8,9}
i want convert jquery arrays mentioned below.
[[1,2,3],[4,5,6],[7.8.9]]
please let me know possible way.
for example case, work :
var ajaxresponse = [1, 2, 3, 4, 5, 6, 7, 8, 9]; var resultarrays = []; (var = 0; < ajaxresponse.length; = + 3) { var tmparray = []; (var j = 0; j < 3; j++) { tmparray.push(ajaxresponse[i+j]); } resultarrays.push(tmparray); }
Comments
Post a Comment