Based off of this Drag/Drop example
If I want to increment the the value (vote) in one of my database tables after the Draggab开发者_运维问答le is Dropped to its container, would I just use $.ajax() within this block below?
drop: function( event, ui ) { $( this ) .addClass( "ui-state-highlight" ) .find( "p" ) .html( "Dropped!" ); }
or would that method not work with this particular plugin?
Yes, that would work.
drop: function( event, ui ) {
$( this )
.addClass( "ui-state-highlight" )
.find( "p" )
.html( "Dropped!" );
$.ajax(/*** your code ***/);
}
精彩评论