Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am going to
serializeObject
and pass the object parameters received from the form.
I pushed to add id parameter but js error. (
data.push is not function
)
I'm asking to
querystring
or push to an array element.
var data = $('form#buildForm').serializeObject() + "¶m=testplanId"; // not working
var data = $('form#buildForm').serialize() + "¶m=testplanId"; // not working
===========this is my sample code==========
$("#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){
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.