一个菜鸟问的问题(高分求救) Nizvoo(瓦匠泥→变哑巴):请说的详细点好吗?我不知道该去看什么。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 父窗用如下方式连接:<a class=menu href=# onclick="window.open('xxxxx.php','','width=300,height=120');return false;">xxxxxx</a>最后子窗自动关闭:<script>opener.location.href='index.php'; //将父窗重定向到index.phpalert('关闭!');window.close();</script> 用js实现,如果你用IE浏览器,可以这样做:a.php---------------------------...<script>function test(){var pReturn = showModalDialog("b.php", "BabyStudio", "font-family:Verdana; font-size:12; dialogWidth:35em; dialogHeight:25em;status:no;");alert(pReturn);}</script><input type="button" value="test" onclick="test()"/>...---------------------------b.php---------------------------...<script>function ok(x){ window.returnValue=x; window.close();}</script><input type="button" value="返回值BabyStudio" onclick="ok('BabyStudio')"/>...--------------------------- 父窗用如下方式连接:<a class=menu href=# onclick="window.open('xxxxx.php','','width=300,height=120');return false;">xxxxxx</a>最后子窗自动关闭:<script>window.opener.documnet.p_txt.value=document.all.c_txt.value;//opener.location.href='index.php'; //将父窗重定向到index.php//alert('关闭!');window.close();</script> blueaurora(蓝色极光):我看了你的方法,我怎么看怎么觉得好象是子窗口来得到父窗口的参数,而我希望的是父窗口得到子窗口的参数,你写的window.opener.document.p_txt是不是子窗口中的一个form对象?document.all.c_txt应该是父窗口的一个对象,所以你用的方法是子窗口得到父窗口的参数,而不是我想要的父窗口得到子窗口的参数 上面的有错误,不好意思试试下面的父窗:昵称:<input type=text id=nick><a class=menu href=# onclick="window.open('xxxxx.php','','width=300,height=120');return false;">改名</a>子窗:<script>function cn(){ window.opener.documnet.all.nick.value=document.all.new_name.value;//opener.location.href='index.php'; //将父窗重定向到index.php//alert('关闭!');window.close();}</script><input tyep=text id=new_name><input type=button value=改名 onclick="cn()"> 子窗:window.opener.documnet.all.nick.value=document.all.new_name.value;改为window.opener.document.all.nick.value=document.all.new_name.value;一样的,只要把父窗口的<a class=menu href=# onclick="window.open('xxxxx.php','','width=300,height=120');return false;">改名</a>改为<input type=button value=改名 onclick="javascript:window.open('xxxxx.php','','width=300,height=120');return false;">子窗口的<input type=button value=改名 onclick="cn()">改为<a href=# onclick="javascript:cn()">改名</a> 怎样模拟鼠标点击 另一个页面的a标签按钮 时间少了8小时,如何改正 php数字循环,一直循环下去 gb2312 编码问题。 求一则正则表达式 PHP中实现不同文件下的调用 这种问题如何解决 用php和mysql做的比较好的电子商务系统有哪些啊?请赐教! 见者有分,请多指教 php使用laravel框架,访问时403错误,根目录定位到public就可以访问了,为什么呢?求解答,谢谢 $_SESSION["name"]怎么会为空??急救!!!!! 小问题,我是菜菜鸟!
<a class=menu href=# onclick="window.open('xxxxx.php','','width=300,height=120');return false;">xxxxxx</a>最后子窗自动关闭:
<script>
opener.location.href='index.php'; //将父窗重定向到index.php
alert('关闭!');
window.close();
</script>
a.php
---------------------------
...
<script>
function test()
{
var pReturn = showModalDialog("b.php", "BabyStudio", "font-family:Verdana; font-size:12; dialogWidth:35em; dialogHeight:25em;status:no;");
alert(pReturn);
}
</script>
<input type="button" value="test" onclick="test()"/>
...
---------------------------b.php
---------------------------
...
<script>
function ok(x)
{
window.returnValue=x;
window.close();
}
</script>
<input type="button" value="返回值BabyStudio" onclick="ok('BabyStudio')"/>
...
---------------------------
<a class=menu href=# onclick="window.open('xxxxx.php','','width=300,height=120');return false;">xxxxxx</a>最后子窗自动关闭:
<script>
window.opener.documnet.p_txt.value=document.all.c_txt.value;
//opener.location.href='index.php'; //将父窗重定向到index.php
//alert('关闭!');
window.close();
</script>
试试下面的父窗:
昵称:<input type=text id=nick>
<a class=menu href=# onclick="window.open('xxxxx.php','','width=300,height=120');return false;">改名</a>子窗:
<script>
function cn(){
window.opener.documnet.all.nick.value=document.all.new_name.value;
//opener.location.href='index.php'; //将父窗重定向到index.php
//alert('关闭!');
window.close();
}
</script>
<input tyep=text id=new_name>
<input type=button value=改名 onclick="cn()">
window.opener.documnet.all.nick.value=document.all.new_name.value;
改为
window.opener.document.all.nick.value=document.all.new_name.value;一样的,只要把父窗口的<a class=menu href=# onclick="window.open('xxxxx.php','','width=300,height=120');return false;">改名</a>
改为<input type=button value=改名 onclick="javascript:window.open('xxxxx.php','','width=300,height=120');return false;">
子窗口的<input type=button value=改名 onclick="cn()">
改为<a href=# onclick="javascript:cn()">改名</a>