-1
我有一個AJAX表單提交本的responseText:jQuery的嵌套JSON解析每個循環
"{"form_errors": {"first_name": ["Can only contain a-z, A-Z and -"]}, "messages": [{"message": "dur", "level": 40, "extra_tags": "danger"}]}"
我需要能夠遍歷所有form_errors如:
$.each(errors, function(index, value)
{
if (index !== "__all__")
{
apply_form_field_error(index, value);
}
});
我曾嘗試: var errors = JSON.parse(data.responseText ['form_errors']); 試圖讓自己的東西循環但無法以適當的方式訪問form_errors循環。
任何想法?
非常感謝
感謝訪問。剛纔我也明白了。非常感謝 – user1496093