Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Achor标签一次禁用和启用';让我们振作起来_Html_Jquery_Hyperlink_Anchor - Fatal编程技术网

Html Achor标签一次禁用和启用';让我们振作起来

Html Achor标签一次禁用和启用';让我们振作起来,html,jquery,hyperlink,anchor,Html,Jquery,Hyperlink,Anchor,在ajax调用成功后,我必须禁用acnhor标记。我试过了 什么都没用。这是我的密码 <div class="container col-md-offset-1"> <div class="row-fluid top-space-20"> <table id="table" class="table table-strip

在ajax调用成功后,我必须禁用acnhor标记。我试过了

什么都没用。这是我的密码

<div class="container col-md-offset-1">
        
            <div class="row-fluid top-space-20">
                <table id="table" class="table table-striped">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>role</th>
                            <th>status</th>
                            <th>Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        
                        <tr>
                            <td>{{using the each for loop }}</td>
                            <td><a id="deleteId" class="href-link" href="/goto" }}">{{
                                   my_data}}</a>
                            </td>
                           
                        </tr>
                       
                    </tbody>
                </table>
                
    <script>
        // Remove button event trigger
        $('#confirmdeletemodal').on('shown.bs.modal', function (e) {
            var triggeringElement = $(e.relatedTarget);
            $(this).find('#remove-button').attr('href', $(e.relatedTarget).data('href'));
            var modal = $(this)
            modal.find('.modal-body').text('Are you sure you wish to delete this ' + triggeringElement.data("jobrole") + ' data? ')
            $("#remove-button").on('click', function () {
                var jobid = triggeringElement.data('href');
                $.ajax({
                    type: 'POST',
                    url: '/delete',
                    data: { 'id': $(e.relatedTarget).data('href') },
                    success: function (data) {
                        console.log("Inside");
                        $("#deleteId").addClass('not-active').removeAttr("href");
                        var msg = "The role deleted is ";
                        $('#myModal').modal('show');
                        $('#myModal .modal-body p').html(msg);
                        console.log("outside");


                    }
                })

            })
        })

    </script>
    

身份证件
角色
地位
行动
{{使用each for循环}}
//移除按钮事件触发器
$('confirmdeletemodal').on('show.bs.modal',函数(e){
var triggeringElement=$(即相关目标);
$(this.find('#remove button').attr('href',$(e.relatedTarget.data('href'));
var modal=$(此)
modal.find('.modal body').text('是否确实要删除此'+triggeringElement.data(“jobrole”)+'数据?'))
$(“#删除按钮”)。在('单击',函数(){
var jobid=triggeringElement.data('href');
$.ajax({
键入:“POST”,
url:“/delete”,
数据:{'id':$(e.relatedTarget).data('href')},
成功:功能(数据){
控制台日志(“内部”);
$(“#deleteId”).addClass('not-active').removeAttr(“href”);
var msg=“角色已删除”;
$('myModal').modal('show');
$('#myModal.modal body p').html(msg);
控制台日志(“外部”);
}
})
})
})

我在表中列出了一组数据。在执行这个ajax操作之后,我必须禁用表中显示的锚。我该怎么做

您只需添加禁用
指针事件的类
-

样品-

$(“#按钮”)。在('click',function()上{
$('a.link').addClass('disable-click');
});
。禁用单击{
指针事件:无;
}

身份证件
角色
地位
行动
1.
M
P
使残废

嗨,有很多这样的TR吗?