即使URL被选中,F5键也不起作用。

编程入门 行业动态 更新时间:2024-10-09 19:24:33
本文介绍了即使URL被选中,F5键也不起作用。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

F5键不起作用。 即使选择了URL,F5键也不起作用... 页面在提交数据后不应刷新... 因为如果已将数据插入数据库并且我们再按f5数据插入数据库..所以f5不应该工作.. 请任何人帮助我....

F5 key should not work. F5 key should not work even after URL has been selected... page should not get refreshed after submitting the data... because if data has been inserted in to database and if we press f5 again the data is inserting in to database.. so f5 should not work.. Please any one help me....

推荐答案

由于不同浏览器的关键代码实现,我不确定这个解决方案是否适用于所有浏览器。 请参考此 [ LINK ]和有关的信息检测 [键码]用于解决您的问题。 I am not sure solution for this will work across all browsers because of key code implementation of different browsers. Please refer to this [LINK] and information on detecting [keycodes] for the solution of your problem.

注意:如果你想提交数据并留在页面上,你将不得不使用类似AJAX的方法发送数据(而不是ASP.NET提供的内置回发) 在客户端浏览器上,为了在Javascript中禁用/启用F5(使用jQuery): NOTE: If you want to submit the data and to stay on the page, you will have to send the data using AJAX like methodology (instead of the built in Postback that ASP.NET provides) On the client side browser, in order to disable/enable F5 in Javascript (using jQuery): function disableF5(e) { if ((e.which || e.keyCode) == 116) e.preventDefault(); }; // To disable f5

( document )。bind( keydown, disableF5); OR (document).bind("keydown", disableF5); OR

更多推荐

即使URL被选中,F5键也不起作用。

本文发布于:2023-10-26 06:53:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1529400.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:也不   URL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!