传值

来源:互联网 发布:tensorflow 算法 编辑:程序博客网 时间:2024/05/17 03:54

父窗体


function OpenWindow(){ 
window.open('child.html'); 

function setValue(m_strValue){ 
document.getElementById("txt_Value").value = m_strValue; 



子窗体

function CloseWind(){ 
opener.setValue("传值到父窗体"); 
window.close(); 

、、、、、、、、、、、、、、、、、IE、、、、、、、、、、、、、、、、、

父窗体

function doInput() 

var win = window.showModalDialog("Childform.html",window,"dialogWidth=500px;dialogHeight=300px;center=yes;status=no"); 
if(win != null) 

document.getElementById("parentTextBox").value = win; 


子窗体


window.returnValue = document.getElementById("childTextBox").value; 
window.close(); 
}