gpt4 book ai didi

javascript - 如何在JQuery中解除点击和点击提交按钮的绑定(bind)?

转载 作者:行者123 更新时间:2023-11-28 07:00:05 26 4
gpt4 key购买 nike

我想在 JQuery 中提交表单,但是

 <input type="submit" id="yesBank" />

$('#yesBank , #worldBank').on("click", function (e) {
e.preventDefault();
$.blockUI({
message: 'Getting List'
});

//Want to unbind this click JS
//Want to click on submit button from here $(#yesBank).click("");
//Unbinding is done so that it does not execute this
//I am bound to click this button as server is handling a condition on click of it. but i have to display block ui too
});

我的目的是阻止 UI。实际上,当我像这样阻止 UI 时,控件不会转到服务器,页面也不会重新加载。即使我删除了 PreventDefault。有人可以给我看一下片段吗?

最佳答案

You can use chaining 
$('#yesBank , #worldBank').on("click", function (e) {

// rest code goes here

}.off("click")

关于javascript - 如何在JQuery中解除点击和点击提交按钮的绑定(bind)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32247135/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com