I have a response coming back from my server that looks like this
{"Errors":{"ViewModels[0]":"Not a valid number."},"IsValid":false,"SuccessMessage":null}
I want to loop through all the values contrained in Errors(in this case there is only one but there could many).
I tried
function createErrorList(response)
{
for (var i = 0; i < response.Errors.length; i++)
{
var error = response.Errors[i];
alert(error);
}
}
length is alwasy undefined though. So I am not sure what I am doing wrong.