When I press a button I perform an ajax post that returns data. That ajax post both updates data and returns a number to tell me whether or not the button should or should not be highlighted. My problem is, I want the ajax post callback function to return both the number and the updated information. This will be easy to do on the ajax file, but I'm not sure how to do this on the callback function. Here is a simple example below.
$.post(ajax_file,
{
primary_id: primary_id
},
function (data){
//ajax file calls back the number 1 or the number 0. But I want to return more
//than just that. Maybe an array would work?
if (data == 1)
{
$(the_button).addClass('highlighted');
}
else if (data == 0)
{
$(the_button).removeClass();
}
});