嘿傢伙即時有一個愚蠢的問題與AJAX PUT後,我嘗試把JSON數據回服務器認爲它的XML數據,即使我使用:dataType:「應用程序/ JSON」,任何想法,爲什麼這可能他在發生?這是我的PUT的樣子:Ajax PUT數據類型問題
$.ajax({
type: "PUT",
url: bank_url,
dataType: "application/json",
data: {"banking_detail_id": page.viewModel.payer_banking_detail_id(),
"person_id": person_id, "account_number": page.viewModel.payer_account_number(),
"branch": page.viewModel.payer_branch(), "date_inserted": page.viewModel.payer_date_insterted(),
"date_effective": page.viewModel.payer_date_effective(), "account_type": page.viewModel.payer_account_type(),
"account_holder": page.viewModel.payer_account_holder() , "debit_day": page.viewModel.payer_debit_day() ,
"branch_code": page.viewModel.payer_branch_code() , "bank_branch_id": page.viewModel.payer_bank_branch_id(),
"branch_name": page.viewModel.payer_branch_name(), "bank_name": page.viewModel.payer_bank_name(),
"user_id": page.viewModel.payer_user_id()},
});
服務器這樣的迴應:
XHR = { 「長度」:847, 「名」: 「錯誤」, 「嚴重」:「ERROR 「,」code「:」23502「,」detail「:」失敗 行包含(null,1081563,12341234,ABSA ELECTRONIC SETTLEMENT CNT (632005),2013-05-05 00:00:00,2013-05- 06,0,Coetzee MA,1,null, 0)。「,」where「:」SQL statement \「INSERT INTO banking_detail( \ n \ t \ t \ t \ tbanking_detail_id,\ n \ t \ t \ t \ tperson_id, \ n \ t \ t \ t \ taccount_number, \ n \ t \ t \ t \ t分支,\ n \ t \ t \ t \ tdate_inserted, \ n \ t \ t \ t \ tdate_effective,\ n \ t \ t \ t \ taccount_type, \ n \ t \ t \ t \ taccount_holder,\ n \ t \ t \ t \ tdebit_day, \ n \ t \ t \ t \ tbank_branch_id,\ n \ t \ t \ t \ tuser_id)\ n \ t \ t \ tVALUES \ n \ t \ t \ t \ tnew.banking_detail_id,\ n \ t \ t \ t \ tnew.person_id,\ n \ t \ t \ t \ tnew.account_number,\ n \ t \ t \ t \ tnew .branch,\ n \噸\噸\噸\ tnew.date_inserted,\ n \噸\噸\噸\ tnew.date_effective,\ n \噸\噸\噸\ tnew.account_type,\ n \噸\噸\噸\ tnew.account_holder,\ n \噸\噸\噸\ tnew.debit_day,\ n \噸\噸\噸\ tnew.bank_branch_id,\ n \噸\噸\噸\ tnew.user_id)\「\ NPL/pgSQL的 功能banking_detail_view_set(),在SQL語句 」, 「文件第4行」: 「execMain.c」, 「行」: 「1527」, 「程序」: 「ExecConstraints」}
到底是由服務器產生什麼反應?它包括'xhr ='? – Dogbert 2013-05-07 12:17:12