window.open 弹出新窗口的命令;
'page.html' 弹出窗口的文件名;
'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替;
height=100 窗口高度;
width=400 窗口宽度;
top=0 窗口距离屏幕上方的象素值;
left=0 窗口距离屏幕左侧的象素值;
toolbar=no 是否显示工具栏,yes为显示;
menubar,scrollbars 表示菜单栏和滚动栏。
Resizable=no 是否允许改变窗口大小,yes为允许;
location=no 是否显示地址栏,yes为允许;
status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许
父窗体打开页面的javascript
function GoToPage(id)
{
var title="title";
var url="xxxxx.aspx?ID="+id+"&Radom="+Math.random();;
var Width="700";
var Height="600";
var arguemnts = new Object();
arguemnts.window = window;
if (document.all&&window.print)
{
window.showModalDialog(url,arguemnts,"dialogWidth:" + Width + "px;dialogHeight:" + Height + "px;center:yes;status:no;scroll:yes;help:no;");
//或者window.showModelessDialog
//模态窗口在关闭后可以直接在后面跟上刷新的语句
window.location.reload();
}
else
{
window.open(url,"","width=" + Width + "px,height=" + Height + "px,resizable=1,scrollbars=1");
}
}
在 window.open打开的窗口中,关闭子窗口并刷新父窗口
window.opener.location.reload();window.opener=null;window.close();
在window.showModalDialog打开窗口中,关闭子窗口并刷新父窗口
window.dialogArguments.window.location = window.dialogArguments.window.location; self.close();
function openIDVarWin(latnId,name,id,flag){
/*var features = "dialogHeight:350px;dialogWidth:500px;scrollbars:0;status:0";// 'width=1200,height=400,left='+(screen.width-800)/2+',top='+(screen.height-400)/2+',scrollbars=yes';
var win = window;
if (window.dialogArguments && window.dialogArguments.window) {
win = window.dialogArguments.window;
}
win.showModalDialog('/CustManageWeb/servlet/IDVar?latnId=' + latnId + '&name=' + name + '&id=' + id, window, features);
*/
var url = '/CustManageWeb/servlet/IDVar?latnId=' + latnId + '&name=' + name + '&id=' + id + '&flag=' + flag;
var pageType = '${custBaseInfoForm.viewPageType}';
if(pageType=='B01'){
var token = parent.parent.document.getElementById("SSO_AUTH_TOKEN_KEY").value;
//alert(token);
url += '&appid=104&COM.TYDIC.SSO_AUTH_TOKEN='+token;
}
var iTop = (window.screen.availHeight-30-350)/2;
var iLeft = (window.screen.availWidth-10-500)/2;
window.open(url,"window","width=500px,height=350px,top="+iTop+",left="+iLeft+",status=no,resizable=no,toolbar=no,menubar=no");