我从第三方服务器得到了这个json响应:
$jsonResponse = {"errors":[],"param_errors":[{"errors":[{"desc":"the email jb004@gmail.com is already registered by another account","code":"account_mail_is_used"}],"name":"account.mail"}],"code":"BAD_REQUEST","object":"error"}
我想只提取说明电子邮件已经注册的文字。你能帮忙吗?
答案 0 :(得分:0)
$jsonResponse.paramErrors.forEach(function(paramError) {
paramError.errors.forEach(function(error) {
if(error.code==='account_mail_is_used')
{
// error found, do what u want with this error
console.log(error.code, error.desc);
}
}
}
});