开发者

Using AJAX with Drag/Drop jQuery plugin

开发者 https://www.devze.com 2023-02-18 07:56 出处:网络
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()

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 ***/);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消