bob_cobb
bob_cobb

Reputation: 2269

Using AJAX with Drag/Drop jQuery plugin

Based off of this Drag/Drop example

If I want to increment the the value (vote) in one of my database tables after the Draggable 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?

Upvotes: 0

Views: 959

Answers (1)

user657496
user657496

Reputation:

Yes, that would work.

drop: function( event, ui ) {
    $( this )
        .addClass( "ui-state-highlight" )
        .find( "p" )
        .html( "Dropped!" );
    $.ajax(/*** your code ***/);
}

Upvotes: 1

Related Questions