我仅在 IE9 中收到“网页已过期”
错误。我正在调用一个带有 2 个提交按钮(图像按钮)的模式对话框。当我点击它们时
我可以看到弹出窗口,然后收到“网页已过期”消息。
我的功能:
moreSubscribersQuestions: function () {
var dlg= $("#dialogMoreClients").dialog({
modal: true,
//dialogClass: 'WsErrorMessage'
dialogClass: 'addMoreClientPopUp',
width: 500,
height:400
});
$('.ui-helper-clearfix:after').removeClass();
//$('div.FinishPurchasePopUpBTn').each(function () {
// this.addClass('FinishPurchasePopUpBTn');
//});
dlg.parent().appendTo(jQuery("form:first"));
}
删除 dlg.parent().appendTo(jQuery("form:first"));
后,该问题不再出现。有什么建议么?
最佳答案
这篇文章The Most Likely Cause of "Webpage Has Expired" Fraser Sherman 描述了您可能在 IE 中看到该错误的一些原因。以下是 forum post 的一些额外想法我读过。
在不确切知道您在做什么的情况下,听起来您可能执行了 POST(可能使用 ASP.NET),然后尝试将用户重定向到其浏览器历史记录中的页面。
解决该问题的选项可能是...
- 寻找除
window.history.go
或类似技术(首选)之外的另一种方法来重定向用户 - 确保页面不可缓存(可能会影响性能)
- 将页面踢入兼容模式(最后的手段)
查看对话框内的代码会很有帮助。这可能会让您更深入地了解正在发生的事情。
关于jQuery UI 模态对话框导致网页已过期错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15412739/