dream518518518 2012-04-20 00:59
浏览 47
已采纳

传递变量点击功能jquery容易确认[复制]

Possible Duplicate:
How pass variable in jquery easy confirm

Pass variable to click function jquery easy confirm

By using javascript confim i have done suspending. Now i want to turn this to jquery easy confirm how can i do this

My PHP Code ( this function is called in a loop ):

function prepareRow( $flag, $Id )
{
$rowResponse = '<tr>    
                    <td style="width:12%"> ' . $Id . ' </td>
                    <td><a href="javascript:void(0);" id="suspend" ></a> </td>
                </tr>'; 
return  $rowResponse            
}

Jquery easy confirm link: http://projectshadowlight.org/jquery-easy-confirm-dialog/

I have tried like this but if click on 'yes' i want pass '$id' to it. So that i can suspend row.

Please help me out

$("#suspend").easyconfirm({locale: {
    title: 'Are you sure?',
    text: 'Are you sure, you want to suspend?',
    button: ['No',' Yes'],
    closeText: 'Close'
}});
$("#suspend").click(function() {
    $.post("suspend.php", { "Id" : Id }, 
            function(data){
                $.ajax({
                    type:"POST",
                    url: "prepareTable.php",
                    success: function(data){
                    $("#example").html(data);
                }
                });
            });
});

展开全部

  • 写回答

1条回答 默认 最新

  • doujuan9698 2012-04-26 02:57
    关注

    I have tried example about jquery easy confirm in local system found bug in it. So i have stopped worry about this question and used jConfirm.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部