Hi all, I have an online store, I know understand PHP very well. Starting to pick up the basics with jQuery but a little stuck on how when I do an AJAX request, how I can return multiple values to be displayed in the page. For example, when the user clicks the 'Quick Add' button, I want to change the number of items at the top of the page in the users cart and the total price of everything in the cart.

How can this be done? Any help or advice is appreciated

CyberAlien
—
2011-05-20T07:48:05Z —
#2

Set 'dataType': 'json' when requesting data from server, in your php code generate list of variables for your reply, put it in array and use echo json_encode($result); to echo it. Then in ajax's success event data will contain that array. Parse it to change content.