.ajax({
cache: false,
url: '/Dashboard/ListofNames',
data: {
charSearch: txtboxvalue
},
success: function (res){
var obj = JSON.parse(res); //this object contains 1 index which is 0.
var parseObj = JSON.parse(obj[0].JsonResult) // This line is working i successfully gets the data from index 0
var parseObj2 = JSON.parse(obj[1].JsonResult) //This is not working because index 1 is not existing, what i want is instead of getting an undefined exception, i want to set the index 1 into an empty string or whatever solution that i wont get any undefined exception.
}
});
Любое предложение действительно поможет мне, спасибо.