jQuery中其中一个function出现问题,那么整个function都失效

来源:互联网 发布:java做游戏 编辑:程序博客网 时间:2024/05/19 07:26
在公司做的项目,因为直接屏蔽掉了一个按钮(没有用了),导致出现很多问题,特此总结:js注意点:在前台页面想要屏蔽某一些 按钮的时候,记得要隐藏,而不是直接删掉,因为在一个function中,某一个按钮的点击事件 比如:
$("#BatchDepositView_Btn_Cancel").click(function () {                    $.ajax({                    type: "GET",                    url: "/CardCenter/BatchDeposit/Ajax/DeleteBatchDeposits.ashx",                    data: { _: Math.random() },                    dataType: "json",                    success: function (result) {                        $.messager.alert('消息', result.msg);                        $("#BatchDepositView_Data").datagrid("reload");                    }                });
如果前台界面BatchDepositView_Btn_Cancel的这个按钮没有了,也就是让我们屏蔽了,这个function就失效了,另外,需要重点注意的就是   这个function失效了,那么整个function也就没有作用了,这样就不能正常的实现功能了。 
阅读全文
1 0