jQuery UI Sortable - pass additional data with serialize -


in below code, want pass value listing_id in ajax post:

$('#listing .images').sortable({     tolerance: 'pointer',     update: function(event, ui){         var data = $(this).sortable('serialize');         var listing_id = $('#listing').attr('data-id');          $.ajax({             type: 'post',             datatype: 'json',             url: 'listings/sortimages',             data: data,             success: function(result){                 alert('successfully re-ordered items.');             }         });     } }); 

i have tried:

data.push({name: 'listing_id', value: listing_id});

it says data.push not function.

data.push({name: 'listing_id', value: listing_id}); 

doesn't work because data serialized string. try

data += '&listing_id=' + listing_id; 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -