Jquery sortable serialize

Hey guys,
check out this code below:

$('#reorder').click(function( event){
var order = $('#gallery').sortable('serialize',{key:'string'});

This gives me a string :

I only want the numbers and I want them as an array to send via AJAX to my server side script to re-order the database. Please advise.



The serialize method in the sortable documentation says that it automatically uses array notation when you don’t provide a key.

[indent]It works by default by looking at the id of each item
in the format ‘setname_number’, and it spits out a hash like

Ah excellent, thanks Paul,

I also didn’t realize that:


is the same as: index[0]=2, index[1]=1, index[2]=3, index[3]=4

I am used to sending scalar GET and POST variables but this is the first time I have had to send a vector.