我要去serializeObject
并传递从表单接收的对象参数。
我推添加id参数,但js错误。 (data.push is not function
)
我要问querystring
或推送到数组元素。
var data = $('form#buildForm').serializeObject() + "¶m=testplanId"; // not working
var data = $('form#buildForm').serialize() + "¶m=testplanId"; // not working
===========这是我的示例代码==========
$("#addBuild").on("click", function(){
var testplanId = [[${testplan_id}]]; // Parameter to send.
if(confirm("")){
var data = $('form#buildForm').serializeObject();
data.push({name:'testplanId', value:'testplanId'});
// ajax 처리
$.ajax({
type : "post",
url : "createBuild.json",
data : JSON.stringify(data),
dataType : "JSON",
contentType : "application/json",
success : function(data){
},
}):
}
});