Solved

Passing additional parameter to $(post)

Posted on 2009-07-09
2
535 Views
Last Modified: 2013-11-08
I have a simple(stupid) question.  I'm passing along the contents of form submit via json.  I'm storing the contents in an array (params).  I want to also add an additional parameter to what I'm passing, a value that isn't part of the form.

A speedy response would be appreciated!
var params = $('form :input').serialize();
 
$.post (
  url,
  params,
  myFunction(json) {
 
}
):

Open in new window

0
Comment
Question by:aznprncritic
2 Comments
 

Author Comment

by:aznprncritic
ID: 24818904
Speedier!
0
 
LVL 16

Accepted Solution

by:
anoyes earned 300 total points
ID: 24967102
You might be able to do:

var params = $('form :input').serialize();
params=params+'newparam'='value'

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question