首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

window.showModalDialog方式/模式窗口数据不刷新(缓存)有关问题[转]

2012-10-29 
window.showModalDialog方式/模式窗口数据不刷新(缓存)问题[转]window.showModalDialog方式???? function

window.showModalDialog方式/模式窗口数据不刷新(缓存)问题[转]

window.showModalDialog方式
???? function ShowDialog(url) {
?????????? var iWidth=300; //窗口宽度
?????????? var iHeight=200;//窗口高度
?????????? var iTop=(window.screen.height-iHeight)/2;
?????????? var iLeft=(window.screen.width-iWidth)/2;
?????????? window.showModalDialog(url,window,"dialogHeight: "+iHeight+"px; dialogWidth: "+iWidth+"px;
???? dialogTop: "+iTop+"; dialogLeft: "+iLeft+"; resizable: no; status: no;scroll:no");
???????? }

???? 注意这里的第二个参数,window

4.模式窗口数据不刷新(缓存)问题

jsp页面加入如下语句

<%
????? response.setHeader("Pragma","No-Cache");
?????? response.setHeader("Cache-Control","No-Cache");
????? response.setDateHeader("Expires", 0);
%>

5,模式窗口中,链接弹出新窗口问题

在</head>和<body>间加入<base target="_self">

6.无提示关闭页面的方法
function CloseWin(){
??? var ua = navigator.userAgent; var ie = navigator.appName=="Microsoft Internet Explorer"?true:false;
??? if(ie){
var IEversion = parseFloat(ua.substring(ua.indexOf("MSIE ")+5,ua.indexOf(";",ua.indexOf("MSIE "))));
??? if( IEversion< 5.5){
??? var str = '';
??? document.body.insertAdjacentHTML("beforeEnd", str);
???? document.all.noTipClose.Click();
?? } else {
????? window.opener =null; window.close();
?? }
}else{
window.close()
}
}

?

你的modalDialog是不是只用了一个页面组成的?应该用一个框架构成




以前我也碰到过类似的问题,用这种方法应该可以解决


to wuzhu888(繁华的夜景)
我的showModalDialog里面有form。

to test_1982(Learner)
我试试看


在页面前面加上
<%
response.addHeader("Pragma", "no-cache");
response.addHeader("Cache-Control", "no-store");
%>


frameset才是容器,frame包含在里面,写反了。不好意思。


<%
response.addHeader("Pragma", "no-cache");
response.addHeader("Cache-Control", "no-store");
%>

或者给打开的url加个随机参数
var num=Math.random();


to operfume(橘子香水)
我加了


用frameset可以解决这个问题

热点排行