http://www.bigant.cn/test/ui.htm为什么打开子窗体后,他的值不会累计上升父窗体
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script language=javascript >
function openwin(name)
{
var win = window.open("ui2.htm",name,"width=400,height=400") ;
win.txt.value = win.txt.value + "\r\n" + name ;
win.focus() ;
}
</script>
</head>
<body><input type="button" onclick="openwin('1')" value="win1"/>
<input type="button" onclick="openwin('2')" value="win2" />
</body>
</html>
子窗体<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
</head>
<body>
<textarea id="txt" style="width:300px;height:300px;"></textarea>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script language=javascript >
function openwin(name)
{
var win = window.open("ui2.htm",name,"width=400,height=400") ;
win.txt.value = win.txt.value + "\r\n" + name ;
win.focus() ;
}
</script>
</head>
<body><input type="button" onclick="openwin('1')" value="win1"/>
<input type="button" onclick="openwin('2')" value="win2" />
</body>
</html>
子窗体<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
</head>
<body>
<textarea id="txt" style="width:300px;height:300px;"></textarea>
</body>
</html>
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script language=javascript >
var wins = new Array();
function getTalkWinIndex(talkerLoginName)
{
for(var i=0;i<wins.length;i++)
{
if (wins[i].name ==talkerLoginName)
return i ;
}
return -1 ;
}
function openwin(name)
{
var index = getTalkWinIndex(name) ;
var win ;
if (index == -1)
{
win = window.open("ui2.htm",name,"width=400,height=400") ;
wins[wins.length] = {name:name,win:win} ;
win.onload = function(){
win.document.getElementById("txt").value = win.document.getElementById("txt").value + name + "\r\n" ;
}
}
else
{
if(wins[index].win && wins[index].win.open && !wins[index].win.closed)
{
win = wins[index].win;
win.document.getElementById("txt").value = win.document.getElementById("txt").value + name + "\r\n" ;
}
else
{
win = window.open("ui2.htm",name,"width=400,height=400") ;
wins[index].win = win ;
win.onload = function(){
win.document.getElementById("txt").value = win.document.getElementById("txt").value + name + "\r\n" ;
}
} }
win.focus();
}
</script>
</head>
<body><input type="button" onclick="openwin('1')" value="win1"/>
<input type="button" onclick="openwin('2')" value="win2" />
</body>
</html>子窗体<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
</head>
<body>
<textarea id="txt" style="width:300px;height:300px;"></textarea>
</body>
</html>
<script></script>