[英]AJAX and post data : forms
I'm trying to post some data with AJAX. 我正试图用AJAX发布一些数据。 I'm sending a serialized form, but nothing is sent.
我正在发送序列化表单,但没有发送任何内容。 What can go wrong ?
什么可能出错? How can I fix it?
我该如何解决?
$.ajax({
url: 'postcreaorganisation',
type: 'POST',
data: $('#form').serializeArray(),
processData: false,
success: function(data) {
//success action
},
error:function (xhr, ajaxOptions){
//error action
}
});
Thanks in advance! 提前致谢!
Edit : I should specify that I use that code in a dialog confirm button's action. 编辑:我应该指定我在对话框确认按钮的操作中使用该代码。
Make sure your form elements have name
attributes. 确保表单元素具有
name
属性。 jQuery's .serialize
only works with form elements that have name
s. jQuery的
.serialize
仅适用于name
s的表单元素。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.