Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2009
    Location
    USA
    Posts
    23
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Question jQuery: Pass multiple values through .post()

    Hello.

    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:

    Code:
    $.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:

    Code:
     $.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.

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Seems to work fine here. What's Firebug showing as the post data?


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •