在父窗口里怎么获取子窗口返回的数组 具体该怎么做~?能详细点吗~?因为我是刚刚学PHP的~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果使用window.open打开窗口可以用window.opener给父窗口元素赋值.参考参考.... //parent.html<html><head><title>abc</title></head><script>function openWindow(){ window.open('yyy.html','',"top=150,left=200,height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");}</script><body><input type="button" name="button1" value="button1" onclick="openWindow();"><input type="text" name="text1" id="text1"></body></html>//yyy.html<HTML><HEAD><TITLE>yyy</TITLE><script>function send(){ var cbx = document.getElementsByName('cbx'); for (var i=0 , l = cbx.length; i < l ;i++ ) { if (cbx[i].checked == true) { window.opener.document.getElementById('text1').value += cbx[i].value; } }}</script></HEAD><BODY><input type="checkbox" name="cbx" value="1">1<input type="checkbox" name="cbx" value="2">2<input type="checkbox" name="cbx" value="3">3<input type="button" value="click me" onclick="send();" /></BODY></HTML> parent.returnarray = new Array();for(i=0,i<fi.length,i++){if(f1[i].checked){ parent.returnarray.push(f1[i]); alert (f1[i]);//这个是可以执行的,我在网吧,具体的代码不记得了 }window.close(); }在父窗口用returnarray就行了。 验证多选框,有点问题不明白,请教一下 *******急!!JQuery插件 Autocomplete 自动显示######### 一个的特殊的二级联动问题 改变单个链接背景颜色怎么写 比较头大的正则? 很简单的XML节点赋值问题 javascript 的文件包含问题 !!高手进!!怎么才能让asp得到js脚本处理后的结果? 看看这个错误 <a>自动执行问题 左右布局高度调整的js代码在firefox下,效果跟IE不同,帮我看看 动态生成对象
可以用window.opener给父窗口元素赋值.参考参考....
<html>
<head>
<title>abc</title>
</head>
<script>
function openWindow()
{
window.open('yyy.html','',"top=150,left=200,height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
}
</script>
<body>
<input type="button" name="button1" value="button1" onclick="openWindow();">
<input type="text" name="text1" id="text1">
</body>
</html>//yyy.html
<HTML>
<HEAD>
<TITLE>yyy</TITLE>
<script>
function send()
{
var cbx = document.getElementsByName('cbx');
for (var i=0 , l = cbx.length; i < l ;i++ )
{
if (cbx[i].checked == true)
{
window.opener.document.getElementById('text1').value += cbx[i].value;
}
}
}
</script>
</HEAD><BODY>
<input type="checkbox" name="cbx" value="1">1
<input type="checkbox" name="cbx" value="2">2
<input type="checkbox" name="cbx" value="3">3
<input type="button" value="click me" onclick="send();" />
</BODY>
</HTML>
for(i=0,i<fi.length,i++)
{
if(f1[i].checked){
parent.returnarray.push(f1[i]);
alert (f1[i]);//这个是可以执行的,我在网吧,具体的代码不记得了
}
window.close();
}在父窗口用returnarray就行了。