2 qq 25884459 qq_25884459 于 2017.09.18 11:03 提问

前台解析Json串出错,求大神帮忙
{
    "obj": "[{\"contact_channel_detail\":\"5026789\",\"total_new_charge\":\"19.00\",\"total_due_amount\":\"0.00\",\"sum_latefee_amount\":\"0.00\",\"error\":\"0\",\"sum_wavelatefee_amount\":\"0.00\",\"error_message\":\"\",\"cust_name_full\":\"\",\"address_desc\":\"\",\"acct_prepay\":\"0.00\",\"payment_method_type\":\"\",\"arrearageQuery_info\":[[]]}]"
}

2个回答

showbo
showbo   Ds   Rxr 2017.09.18 11:14
已采纳

还没搞定?obj需要在parse过


    var obj = {
        "obj": "[{\"contact_channel_detail\":\"5026789\",\"total_new_charge\":\"19.00\",\"total_due_amount\":\"0.00\",\"sum_latefee_amount\":\"0.00\",\"error\":\"0\",\"sum_wavelatefee_amount\":\"0.00\",\"error_message\":\"\",\"cust_name_full\":\"\",\"address_desc\":\"\",\"acct_prepay\":\"0.00\",\"payment_method_type\":\"\",\"arrearageQuery_info\":[[]]}]"
    }
    obj = JSON.parse(obj.obj);///////
    for(attr in obj[0])alert(attr+'='+obj[0][attr])
qq_25884459
qq_25884459 感谢!
2 个月之前 回复
qq_40291168
qq_40291168   2017.09.18 11:31

有卡json语句 的小工具 可以看出有没有错的

Csdn user default icon
上传中...
上传图片
插入图片