我有一個奇怪的錯誤,其中我的jquery ajax請求不提交所有參數。並非所有的參數發送到jquery ajax調用
$.ajax({
url: "/ajax/doAssignTask",
type: 'GET',
contentType: "application/json",
data: {
"just_a_task": just_a_task,
"fb_post_date": fb_post_date,
"task_fb_postId": task_fb_postId,
"sedia_task_guid": sedia_task_guid,
"itemGuid": itemGuid,
"itemType": itemType,
"taskName": taskName,
"assignedToUserGuid": assignedToUserGuid,
"taskDescription": taskDescription
},
success: function(data, status) {
//success code
},
error: function(xhr, desc, err) {
//error code
}
});
但使用Firebug(和調試),我可以看到,只有這些變量都貼:
assignedToUserGuid
itemGuid
itemType
just_a_task
taskDescription
taskName
它遺漏fb_post_date
,task_fb_postId
,並sedia_task_guid
我不知道什麼原因它只發布一些項目而不是其他項目?有人知道嗎?
數據被髮送到
任何幫助理解asp.net控制器返回jsonresult(因此的contentType)。謝謝!
的完整性檢查的興趣,嘗試添加一個beforeSend
到你的選擇,並確保被髮送的值,並從那裏
如果您正在嘗試發佈內容,請將'type'更改爲'post'。 – rahul 2010-03-17 05:36:31
是的,你是對的...雖然它應該罰款與GET。問題不在服務器端......但似乎與js有關? – rksprst 2010-03-17 05:39:54
你確定所有變量在ajax請求之前都有價值嗎? – 2010-03-17 07:03:51