我想删除工具提示

时间:2014-03-21 14:49:12

标签: javascript

我想在我的网络应用程序中删除工具提示"Do you really want to remove the agent?"。问题是,如果我删除工具提示,则还会删除确认对话框中的内容。我想删除工具提示。以下是我的代码。

function remove(cellvalue, options, rowObject) {
    var sessionEnterpriseId = '<%= session.getAttribute("enterpriseId")%>';
    var sessionRoleId = '<%= session.getAttribute("role")%>';

    if(sessionRoleId == 2) {
        if(rowObject.enterpriseId == sessionEnterpriseId) {
            return "<a href='javascript:confirmDelete("+ rowObject.id +")' ><img src='./images/remove.gif' title='Remove Agent'><div id='dialog-confirm' title='Remove Agent' style='display:none'> <p style='position: absolute; top: 20px; width: 303px;'><span class='ui-icon ui-icon-alert' style='float: left; margin: 0 7px 20px 0;'></span>Do you really want to remove the agent..?</p</div></a>";
        }
        else {
            return "<img src='./images/removeGray.gif' title='Remove Agent'>";
        }
    }
    else {
        return "<a href='javascript:confirmDelete("+ rowObject.id +")' ><img src='./images/remove.gif' title='Remove Agent' ><div id='dialog-confirm' title='Remove Agent' style='display:none'> <p style='position: absolute; top: 20px; width: 303px;'><span class='ui-icon ui-icon-alert' style='float: left; margin: 0 7px 20px 0;'></span>Do you really want to remove the agent..?</p></div> </a>";
    }
}

function confirmDelete ( a ) {  
    $(function() {      
        $( "#dialog-confirm" ).dialog({
            resizable: false,
            height:140,
            modal: true,
            buttons: {
                "YES": function() {
                    $(this).load("./removeAgent.action?id="+a,  function() {
                        $("#agentResult").trigger("reloadGrid");
                    });
                    $(this).dialog("close");
                },
                "   NO    ": function() {
                    $(this).dialog("close");
                }
             }
        });
    });
}

帮我解决这个问题。提前谢谢。

1 个答案:

答案 0 :(得分:0)

语法错误,第7行

</p</div>

这会导致你的jQuery选择器失败。