I am working on a jQuery sortable. I pull information from my database to populate each orderable element and then repost the new order back to my data base. However I cannot figure out how to take the variable that I define in my serialize jQuery and enter it into my AJAX function in the data: area.
Here is my code:
$(document).ready(function()
{
$('#social_list').sortable(
{
update: function()
{
var order = $('#social_list').sortable('serialize');
alert(order);
}
});
});
$.ajax(
{
url: 'save_items_order.php',
data: ?,
type: '$_POST',
success: function(msg)
{
alert(msg);
}
});
So I want to take the string that var order creates and pass it into the ajax so data: = var order string
I tried data: $('#social_list').sortable('serialize'), everything seemed to work it just doesn't seem to update my table