开发者

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 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜