我有这个鬼错误,如标题所示,它显示缺失)在括号中。我已经阅读了类似的一些问题,每个答案都表明JSON有问题。我在我的代码中找不到它。这是:
Ext.Ajax.request({
url: '/procurement/procurementpurchaseorder/cekcost',
method: 'POST',
params: params,
success: function (result, request) {
var returnData = Ext.util.JSON.decode(result.responseText);
if (returnData.success) {
myPanel = Ext.getCmp('abs-budget-panel');
myPanel.body.load({
url: '/procurement/procurement/apppo',
scripts: true,
params: params
});
}
},
failure: function(action){
if(action.failureType == 'server'){
obj = Ext.util.JSON.decode(action.responseText);
Ext.Msg.alert('Error!', obj.errors.reason);
}else{
Ext.Msg.alert('Warning!', 'Server is unreachable : ' + action.responseText);
}
}
});
从第一个网址返回POST JSON:
etc [{"prj_kode": "Q000169", "prj_nama": "Telkomsel IBC 2014", "sit_kode": "210",
"sit_nama": "Poin Square", "sup_kode": "VDR0007", "sup_nama": "Andrew Hongkong Ltd",
"tgldeliesti": "2017-05-29", "tujuan": "Jl. Danau Singkarak No. 65 B-C, Sei Agul, Medan 20117",
"payterm": "-", "typepo": "undefined", "invoiceto": "PT QDC Technologies",
"budgettype": "Project", "ket": "-", "ketin": "-", "val_kode": "IDR", "rateidr": "0", "top": "0"}]
file[]
posts[{"urut": "24", "workid": "1026", "workname": "Material for Common RF Work",
"pr_number": "PRF-15000984", "prj_kode": "Q000145", "sit_kode": "210", "prj_nama": "Telkomsel IBC 2014",
"sit_nama": "Poin Square", "kode_brg": "410011-LEON", "nama_brg": "Coaxial Cable - 7/8 inch",
"qty": "1", uom": "Mtr", "val_kode": "IDR", "currency": "0", "price": "62475",
"tgl_pr": "2017-04-10", "totalPR": "3399.0000", "pricePR": "62475.0000", "totalPricePR": 212352525,
"totalPO": 3001, "totalPricePO": "129900000.00000000", "totalPrice": 62475,
"id": "78173", "sup_kode": "VDR0007", "sup_nama": "Andrew Hongkong Ltd",
"invoiceto": "PT QDC Technologies", "ket":"", "tujuan":"Jl. Danau Singkarak No. 65 B-C, Sei Agul, Medan 20117",
"tgl_kirim": "2017-05-29T00:00:00", "po_term": "-", "top": "0", "budgettype": "Project",
"net_act": 208", "qtySupp": "1", "priceSupp": "62475", "totalPriceSupp": 62475,
"statusppn": "N", "valueppn": 0, "valueppnSupp": 0, "percentppn": 0, "gtotal": 62475}]
我认为我的JSON结构很有用。那么,我错过了什么?请告诉您是否需要有关该问题的更多信息。任何帮助赞赏。
答案 0 :(得分:0)
你的等等json是正确的。问题是你最后一个名为帖子的json。下面是更新的json.Sason中的一些属性没有被双引号正确格式化。通过比较你的两个jsons来检查here。格式来自here的json。
{" urut":" 24"" workid":" 1026""作品名称":& #34;普通RF工作的材料"," pr_number":" PRF-15000984"," prj_kode":" Q000145", " sit_kode":" 210"," prj_nama":" Telkomsel IBC 2014"," sit_nama":&#34 ; Poin Square"," kode_brg":" 410011-LEON"," nama_brg":"同轴电缆 - 7/8英寸" "数量":" 1""计量单位":"港铁"" val_kode":" IDR""货币":" 0""价格":" 62475"" tgl_pr&#34 ;: " 2017年4月10日"" totalPR":" 3399.0000"" pricePR":" 62475.0000" " totalPricePR":212352525" totalPO":3001," totalPricePO":" 129900000.00000000"" totalPrice" :62475" ID":" 78173"" sup_kode":" VDR0007"" sup_nama":&# 34; AndrewHongkongLtd"" invoiceto":" PTQDCTechnologies"" KET":"&# 34;," tujuan":" Jl.DanauSingkarakNo.65B-C,SeiAgul,Medan20117"," tgl_kirim":" 2017-05-29T00: 00:00"," po_term":" - "," top":" 0","预算类型&# 34;:"项目""的net_act":" 208"" qtySupp":" 1"&# 34; priceSupp":" 62475"" totalPriceSupp":62475" statusppn":" N"" valueppn& #34;:0," valueppnSupp":0," percentppn":0," gtotal":62475}