473,226 Members | 1,309 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

AJAX Post objects

256 100+
Hey everyone,

I'm fairly new to javascript. I hardly ever use it, but my newest project is demanding that I have 'dynamic' drop downs where the user can type in their partial matches.

So, I come across jQuery Autocompletes. Works wonderful, except the framework I am using doesn't like using GET methods and they are less safe than POST data.

So I modified the code of the autocomplete to allow me to send POST data, but I am now stuck getting multiple pieces of POST data to pass to the page. Can someone help me?

Expand|Select|Wrap|Line Numbers
  1. $.post(options.url, {p:q}, function(data) {
  2.                 data = parseData(data);
  3.                 //addToCache(q, data);
  4.                 receiveData(q, data);
  5.             });
  8. options.extraParams = options.extraParams || {a:1,b:2}; // for example
How would I pass both {p:q} and options.extraParams to the $.post function?

I have tried {p:q} + options.extraParams but that only posts "[object Object][object Object]"

any help would be appreciated.

Thank you!
May 4 '09 #1
1 1438
256 100+
Hey everyone!
I found a solution to the problem.

jQuery had a built-in function to do just this. My lack of knowledge of what the objects are called made it difficult to define a decent enough search for my purpose.

A few texts between a friend and me helped me define the words for my search and expand the thought.

Associative arrays in javascript appear to be called objects. Their values are properties. Below is the code that allows the merge to take place.

Expand|Select|Wrap|Line Numbers
  1. var settings = { validate: false, limit: 5, name: "foo" };
  2. var options = { validate: true, name: "bar" };
  3. jQuery.extend(settings, options);
May 4 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Tony | last post by:
I just noticed that prototype.js is one of the files in the Ajax.NET distribution - I'm pretty concerned about this. Does anyone know if this is the same "prototype.js" that is not well-liked...
by: geevaa | last post by:
http://www.phpbuilder.com/columns/kassemi20050606.php3 XMLHttpRequest and AJAX for PHP programmers James Kassemi Introduction: Although the concept isn't entirely new, XMLHttpRequest...
by: JamieHowarth0 | last post by:
Hi folks, I have a bit of a headache. I've finally added all the nice finishing touches to my own website (static only with a bit of DHTML). Now I've just converted the whole thing to AJAX with a...
by: George | last post by:
I am doing an AJAX call using JQuery on my page to which returns JSON objects and everything works fine. Now I decided to use ashx handler instead of and simply write JSON out. Then my problems...
by: usha535140 | last post by:
Hi, Can we use Ajax RoundedCornersExtender control with AJax,tabContainer?
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.