The page cannot be refreshed without resending ...
来源:互联网 发布:手机备份数据有必要吗 编辑:程序博客网 时间:2024/06/08 04:33
昨天遇到一个这样得问题,在弹出的子页中用:
window.opener.location.reload();
去刷新父页中时,当父页如果有提交表单时,会出现"The page cannot be refreshed without resending the information....",后改为:
window.opener.location.href = window.opener.location.href;
window.opener.location.reload();
则不会再出现那个讨厌的提示框。
但是加入你要传递信息回去的话,恐怕你也许会用
window.opener.location.href = window.opener.location.pathname + "?X=y";
或
修改window.opener.location.search;
这样若修改后的URL与原来的不一致的话,父页也会刷新(假如X=y在你的代码中为一定值的话,当你你再次打开子页时,则URL值不会被修改)。但是修改后的URL与原来的一致的话,则父页不会刷新。此时如果你加上window.opener.location.reload()即用:
window.opener.location.href = window.opener.location.pathname + "?X=y";
window.opener.location.reload();
或
修改window.opener.location.search;//第一次
window.opener.location.reload();//第二次
这样父页就会被刷新。但如果修改后的URL有变化的话,这样写的话,父页将会被刷新两次。而且第二次刷新的时候,会丢失你添加的回传信息,因为此时执行的是修改前的URL。
综上,如果你不用回传信息时,这样写就可以了:
window.opener.location.href = window.opener.location.href;
window.opener.location.reload();
如果需回传信息时,而且回传的信息每次都有变化,则更简单:
修改window.opener.location.search;
但是需要回传定值信息时,我还想不起什么好的方法,变相的方法是:
window.opener.location.href = window.opener.location.href + "?X=y";
这样每执行一次的话,X的值将会增加一个y(第一次为y,二次为yy,三次为yyy),然后分析X的值,取出y。
- The page cannot be refreshed without resending ...
- The page cannot be refreshed without resending ... 昨天遇到一个这样得问题,在弹出的子页中用:
- The page cannot be displayed
- The page cannot be found
- The page cannot be displayed
- Network Access Message: The page cannot be displayed
- The type cn.XXXXX.jk.utils.Page cannot be resolved.
- The requested page cannot be accessed because the related configuration data for the page is invalid
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the...
- The file contains a character that cannot be represented in the current code page (936)
- warning C4819: The file contains a character that cannot be represented in the current code page
- VSE: The file contains a character that cannot be represented in the current code page (936).
- warning C4819: The file contains a character that cannot be represented in the current code page
- warning C4819: The file contains a character that cannot be represented in the current code page
- 异常 The page you are requesting cannot be served because of the extension configuration
- warning C4819: The file contains a character that cannot be represented in the current code page
- Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associat
- 错误 The XML page cannot be displayed |无法显示 XML 页 的解决方法
- 情感不等式
- 在SQL中调用COM对象
- ▲UTF-8 and Unicode FAQ[转]
- 男女对爱情的不同回味
- 与老婆相处十日(一)
- The page cannot be refreshed without resending ...
- 如何获取Web页面中radio按钮的值
- 文件的共享
- ip phone日志6
- about face2.0——第三章(2):为中等用户优化
- 程序员必看:关于SQL Server的若干注意事项
- Discuss
- java-Dom4j 编码问题彻底解决
- 它不认识僵尸