我使用了jquery-ui-dialog来作为弹出窗口$(function () {
    $("#dialog:ui-dialog").dialog("destroy");
    $("#Div_Shouquan").dialog({
        autoOpen: false,
        height: 350,
        width: 520,
        resizable: false,
        modal: true
    });
    $("#ButShouquan").click(function () {
        $("#Div_Shouquan").dialog("open");
        return false;
    });
});我的这个dialog,是通过一个click事件触发打开的。
<a href="javascript:void(0);" name="10" id="ButShouquan"></a>
通过这个a链接,打开dialog,那能否把<a>链接的name值,传给这个dialog呢?
dialog

解决方案 »

  1.   

     $(function () {
        $("#dialog:ui-dialog").dialog("destroy");
        $("#Div_Shouquan").dialog({
            autoOpen: false,
            height: 350,
            width: 520,
            resizable: false,
            modal: true
        });
        $("#ButShouquan").click(function () {
             var name= $.trim($(this).attr("name"));//取值,传值看看参数
            $("#Div_Shouquan").dialog("open");
            return false;
        });
    });