Hi,
There is small change in your code. In for loop, you are using text property of div element, which takes only last item from array every time. In every count of for loop, div text is override that's why only last item from array display. You should use append rather that text.
I made some changes in your code :
function successHandler(data) {
var jsonObject = JSON.parse(data.body);
var dataArr = $.makeArray(jsonObject.d.results);
var resultArr = $.map(dataArr, function (item) {
return { label: item.Title, value: item.Url };
});
var arrayLength = resultArr.length;
for (var i = 0; i < arrayLength; i++) {
$("#result").append(resultArr[i].label + " " + resultArr[i].value + "<br />");
}
}
Check this code.
Thank you