showdialog 在IE8中的post方法是打开一个新窗口,与火狐不同。所以如果在模态窗口里提交给后台的一些操作, 会造成不能控制关闭窗口的功能。解决办法是在<head></head>里加入<base target="_self" />.这样IE8里就好用了。
见如下代码:
ssa_list_content.cfm 写道
<script type="text/javascript" language="javascript">
function respond(e){
while(e.tagName != "TR")
{
e = e.parentNode;
}
var str = $(e).find("#lblACTVTYID").text();
var requsetIDStr = $(e).find("#lblRequsetID").text();
var result=window.showModalDialog('ssa_respond.cfm?ACTVTY_ID=' + str+'&REQT_ID='+requsetIDStr,'_blank','dialogWidth:500px;dialogHeight:500px;center:no;status:no');
if (result != null)
{
alert(result);
document.getElementById("formPostBackHandler").submit();
}
}
</script>
ssa_repond.cfm 写道
<head>
<base target="_self" />
</head>
ssa_gateway.cfc 写道
<script language="javascript">
window.returnValue = "Thank you for accepting the terms and conditions of the Single Service Agreement. You may now commence the Services in accordance with the terms and conditions of the Single Service Agreement.";
window.close();
</script>
后台返回值给前台,result
window.returnValue 返回值
分享到:
相关推荐
`Form.ShowDialog`方法会在当前线程中打开一个模态对话框,阻止用户与父窗口或其他窗体交互,直到该对话框关闭。为了在非主线程中显示窗体并使其置顶,你需要确保在正确的线程上执行`ShowDialog`,因为窗体必须在其...
这种方法主要应用于通过window.showModalDialog()创建的模态窗口中。 3. javascript弹出窗口代码:这部分主要介绍了如何使用window.open()方法来创建一个新的浏览器窗口或弹出窗口。window.open()方法支持的环境有...
本篇文章将针对JavaScript弹出窗口的相关问题进行总结,包括无提示刷新网页、刷新页面的方法、弹出窗口代码、模式窗口的数据刷新问题、模式窗口中链接弹出新窗口以及无提示关闭页面的方法。 1. **无提示刷新网页** ...
// 模态窗口宽度 var iHeight = 300; // 模态窗口高度 var iTop = (window.screen.height - iHeight - 100) / 2; var iLeft = (window.screen.width - iWidth) / 2; var returnValue = window.showModalDialog...
在JavaScript编程中,`showModalDialog` 是一个古老但仍然被一些开发者使用的函数,用于以模态对话框的形式打开一个新的窗口。这个对话框会阻止用户与父窗口进行交互,直到对话框关闭。在这个过程中,我们可以传递...