阻止firefox重新加载确认 [英] preventing firefox reload confirmation

查看:494
本文介绍了阻止firefox重新加载确认的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在可编辑的表格中显示某些记录。用户在试图重新加载表的同时编辑一个弹出的记录来警告关于未保存的数据的记录。

 函数cancelProcess ()

{

if(noEditedRecords!= 0)//表中编辑记录的数量

{

var processConfirmation = confirm(你已经编辑了+ noEditedRecords +记录。你确定要撤消所做的更改?

if(processConfirmation == true){

window.onbeforeunload = null;
$ b window.location.reload();}

}}

当他点击Ok重新加载页面时,Firefox提示为 $ b

要显示此页面,Firefox必须发送将重复(例如搜索或订单确认)。



在chrome中打开同一页面时,不会出现这样的提示。 / p>

我试图通过设置 window.onbeforeunload = null; 来避免这种情况,但仍然出现提示窗口。 b

另外,我通过更改Firefox配置来尝试

browser.sessionstore.postdata ;

在mozilla支持页面中建议更改0到1

但是没有任何工作..我如何防止提示???

解决方案

使用

  window.location的= window.location的; 

而不是

  location.reload(); 

适合我。


I'm displaying certain records in an editable table. The user when attempts to reload the table while editing a record a pop up comes warning the record about the unsaved data.

function cancelProcess()

 {

if(noEditedRecords !=0)//number of edited records in the table

{

    var processConfirmation = confirm("You've Edited "+ noEditedRecords +" Records. Are You sure to undo the Changes made?");

    if (processConfirmation ==true){

            window.onbeforeunload = null;        

            window.location.reload();}

}}

When he clicks Ok to reload the page, Firefox prompts as

"To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier."

And when opening the same page in chrome, no such prompt appears.

I tried to avoid this by setting window.onbeforeunload = null;, but still the prompt window appears there.

Also I tried by changing Firefox configuration

browser.sessionstore.postdata;

Changed 0 to 1 as suggested in mozilla support page.

But nothing worked.. How i prevent the Prompt???

解决方案

Using

window.location=window.location;

Instead of

location.reload();

work for me.

这篇关于阻止firefox重新加载确认的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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