我在可编辑表格中显示某些记录。当用户尝试重新加载表格而编辑弹出的记录时,会警告有关未保存数据的记录。阻止Firefox重新加载确认
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();}
}}
当他单击确定重新加载页面,Firefox的提示为
“要显示此页面,火狐必须发送将重复任何操作(如搜索或订单确认),这是信息“
而当在chrome中打开同一页面时,不会出现这样的提示。
我试图通过设置来避免这种情况window.onbeforeunload = null;,但仍然出现提示窗口。
另外我试图通过改变火狐配置
browser.sessionstore.postdata;
更改0到1按照mozilla支持页面中的建议。
但没有工作..我如何防止提示???
我有一种感觉,你需要的是来自不同你在问什么。你有没有机会展示你的代码? –
@JesseJ已包含代码.. – Emmi