Solved

Passing additional parameter to $(post)

Posted on 2009-07-09
2
542 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

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…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

707 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