View Full Version : jQuery: Pass multiple values through .post()

11-24-2010, 01:26 AM

I'm having a problem passing multiple values through the jQuery post() function. For example, if I use the following line for the post() function parameters:

$.post("like.php", {item: $("#item").html()}, function(xml) {
It submits the html from the #item container later in the document successfully. However, if I try to submit three of these types of values, then no values are passed to the PHP file at all. Here is what I am using:

$.post("like.php", {item: $("#item").html(), liker: $("#liker").html(), unlike: $("#unlike").html()}, function(xml) {
As you can see, the syntax is similar, except I am passing #liker and #unlike values through .post() as well, but passing more than one value ends up not working.

Am I using incorrect syntax or is there something else wrong here? Any help would be much appreciated. Thank you.

11-24-2010, 10:39 AM
Seems to work fine here. What's Firebug showing as the post data?