With jQuery I\'m retrieving positions of a sortable list using \'serialize\', like this:
var order = $(\'ul\').sortable(\'serialize\');
The vari
I think the best way is not to use sortable('serialize') at all, but use jQuery to simply iterate over the sorted ids, like so:
order = [];
$('ul').children('li').each(function(idx, elm) {
order.push(elm.id.split('_')[1])
});
$.get('ajax.php', {action: 'updateOrder', 'order[]': order});
This has an advantage over explicitly appending the serialized sortable to the URL (or a parameter) in that it doesn't include the order[] parameter at all if there are no li in the list. (When I had this problem I was using sortable(connectWith: 'ul') so it was entirely possible for a user to drag all the li from one list). In contrast appending the serialized sortable would leave an unwanted '&'.