473,378 Members | 1,426 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,378 software developers and data experts.

AJAX Post objects

blyxx86
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.             });
  6.  
  7.  
  8. options.extraParams = options.extraParams || {a:1,b:2}; // for example
  9.  
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 1449
blyxx86
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.

http://docs.jquery.com/Utilities/jQuery.extend
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);
  4.  
May 4 '09 #2

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

Similar topics

31
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...
1
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...
3
JamieHowarth0
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...
3
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...
3
by: usha535140 | last post by:
Hi, Can we use Ajax RoundedCornersExtender control with AJax,tabContainer?
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.