Jquery return multiple 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:53 UTC
Read the original article Hit count: 774

Filed under:
|

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?

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

Related posts about JSON