是否有一个jQuery事件,我可以监视是否取消了表单提交? [英] Is there a jQuery event that I can monitor if form submission is cancelled?

查看:57
本文介绍了是否有一个jQuery事件,我可以监视是否取消了表单提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在表单提交中有一些Javascript代码,该代码将数据表显示为灰色,并覆盖了加载图像以指示正在重新加载.

I have some Javascript code on a form submit that greys out a table of data and overlays a loading image to indicate that the reload is occurring.

问题是,如果用户取消了页面重新加载,则表将保持为灰色.我想知道页面提交是否被取消了,如果取消了,请退回表格并删除覆盖.

The problem is that if the page reload is cancelled by the user, the table stays greyed out. I would like to notice if the page submit was cancelled, and if so, fade the table back in and remove the overlay.

我的问题是:在取消新页面的加载时,是否可以使用直接Javascript或jQuery绑定到某个事件?

My question is: Is there an event I can bind to using either straight Javascript or jQuery for when loading of a new page is cancelled?

我已经在Google上搜索了很多东西,但是如果有答案,那么在众多询问如何取消提交动作的人中我看不到它.

I've googled quite a bit for something, but if there's an answer, I can't see it amidst the mass of people asking how to cancel a submit action.

推荐答案

让用户取消事件处理程序以取消灰阶效果如何? IE.而不是等待取消通知,请成为取消的处理程序.

How about having an event handler for the user cancel that undoes the grey out? I.e. rather than waiting to be alerted of the cancel, become the handler of the cancel.

这篇关于是否有一个jQuery事件,我可以监视是否取消了表单提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆