jQuery.submit 从 3.3 开始已被弃用,替代方案是什么?

标签 jquery

通过查看来源你可以看到:

/**
 * Bind an event handler to the "submit" JavaScript event, or trigger that event on an element.
 *
 * @param handler A function to execute each time the event is triggered.
 * @see {@link https://api.jquery.com/submit/}
 * @since 1.0
 * @deprecated 3.3
 */

但是 jQuery 博客 here 中似乎没有提到这一点。现在它已被标记为已弃用,有什么替代方案吗?

最佳答案

您可以使用.on

$(selector).on("submit", callback)

欲了解更多信息,请访问 http://api.jquery.com/on/

关于jQuery.submit 从 3.3 开始已被弃用,替代方案是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49038654/

相关文章:

javascript - 获取我的行表的 id

javascript - 基于当前 URL 问题的事件导航类

javascript - jQuery : Append jquery variable to a class name

JQuery 解决方案通过单击输入字段附近的按钮来发现输入字段 ID/名称值

javascript - 修复 Buggy JQuery 动画

javascript - 如何在javascript中合并具有相同值的json数组

javascript - 试图弄清楚如何接收发送到其他网页的值(value)

javascript - onchange 显示 GridView 记录(如果使用 Javascript 从数据库中存在)

javascript - div点击事件在iframe结束时不上升?

javascript - jQuery 在单击操作期间选择了错误的元素