Jquery return mulitple values in ajax call

Posted by Scarface on Stack Overflow See other posts from Stack Overflow or by Scarface
Published on 2010-04-03T15:39:57Z Indexed on 2010/04/03 15:43 UTC
Read the original article Hit count: 200

Filed under:

Hey guys quick question, I have a jquery post function that returns a response on success after the click of a div, however I would like to return multiple variables on success. Do I have to use JSON, and if so, is it possible to integrate it into the $.ajax function after success? Thanks in advance for your time.

$.ajax({
   type: "POST",
   data: "action=favorite&username=" + username + "&topic_id=" + topic_id + "&token=" + token,
   url: "favorite.php",
   success: function(response)
   {


   }
  });

© Stack Overflow or respective owner

Related posts about jQuery