方法一、
主页面打开新窗口js 事件:
function ShowModelWindow() {
var iTop = (window.screen.height - 600) / 2;
var iLeft = (window.screen.width - 500) / 2;
var reVal = window.showModalDialog('BasicType.aspx' ,
'dialogHeight: 300px; dialogWidth: 100px;dialogTop: ' + iTop + '; dialogLeft: ' + iLeft + '; edge: Raised; center: Yes; help: Yes; resizable: no; status: Yes;scroll:no;');
if (typeof (reVal) != 'undefined') { form1.txtScd_Type.value = reVal; }//接收回传value
}
新打开窗口确定按钮:
function ConfirmBack() {
window.returnValue = "要返回的value";
window.close();
}
方法二、
主页面打开新窗口js 事件:
function ShowModelWindow() {
var iTop = (window.screen.availHeight - 510) / 2; //获得窗口的垂直位置;
var iLeft = (window.screen.availWidth - 650) / 2; //获得窗口的水平位置;
window.open('GetHsCodeInfo.aspx', '', 'height=510px, width=650px, top=' + iTop + ',left=' + iLeft + ', toolbar=no,menubar=no, scrollbars=yes, resizable=no,location=no, status=no')
}
新打开窗口确定按钮:
function ConfirmBack(a, b, c) {window.opener.document.getElementById("txtCategory").value = a;
window.opener.document.getElementById("txtHS_Code").value = b;
window.close();
}