如何利用脚本传值 在a.html用window.open打开b.htmlb可得到opener对象,这个opener就是指到a.html的window对象 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 a.htm onclick="window.open('b.htm','')"文本框ProductImageB.htmwindow.opener.form.ProductImage.value='<%=filename%>'; 我的a.html<script> function open2(){ window.open("b.htm","ceshi","height=350,width=350"); }</script><body> <form name="form2"action="" method="get"> <input name="aa" type="text"> <input name="a" type="button" value="open2" onClick="open2()"> </form></body>b.html<script> function guanbi(){ window.opener.form.ProductImage.value = document.form1.aa.value; alert(document.form1.aa.value); window.close(); }</script><body> <form name="form1"action="" method="get"> <input name="aa" type="text"> <input name="a" type="button" value="closed" onClick="guanbi()"> </form></body>请哪个高人帮我看下哪里错了。 b.htm<script> function guanbi(){ window.opener.form2.aa.value = document.form1.aa.value; alert(window.opener.form2.aa.value); window.opener=null; window.close(); }</script><body> <form name="form1"action="" method="get"> <input name="aa" type="text"> <input name="a" type="button" value="closed" onClick="guanbi()"> </form></body> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><TITLE> New Document </TITLE><SCRIPT LANGUAGE="JavaScript"><!--function setValue(){ document.Form1.txt1.value= "changed" ; newoption = new Option("changed","changed"); document.Form1.sel1.add(newoption);}function openWin(){ objWin = window.open('',''); objWin.document.open(); objWin.document.write ("<body bgcolor=#cccccc></body>"); objWin.document.write ("<input type='button' value='SetValue' onclick='opener.setValue();window.opener=null;window.close()'>"); objWin.document.write ("<input type='button' value='CloseMe' onclick='if(opener.closed){window.opener=null;window.close()}'>"); objWin.document.close;}//--></SCRIPT></HEAD><BODY><FORM name="Form1" METHOD=POST ACTION=""><INPUT TYPE="text" NAME="txt1" value="default"><INPUT TYPE="button" NAME="abc" onclick="openWin()" value="openWin"><select name="sel1"></select></FORM></BODY> 怎么判断土豆的视频播放完成了啊? 请问的大家有推荐的学习HTC(HTML Components)的书吗? javascript 调用Outlook 问题 。。。。 jquery是不是真的很好用 jsp获取当前位置的问题 我的Javascript代码让IE7卡住了 数组问题 请问如何在JS里动态添加或者改变表单的事件 如何使动态表格隔一行换一种颜色显示? innerHtml的问题 如何在 ie中点击 一个按扭 就启动本地的画图、计算器等程序呀 请教文本框自动赋值问题???谢谢
onclick="window.open('b.htm','')"
文本框ProductImage
B.htmwindow.opener.form.ProductImage.value='<%=filename%>';
<script>
function open2(){
window.open("b.htm","ceshi","height=350,width=350");
}
</script>
<body>
<form name="form2"action="" method="get">
<input name="aa" type="text">
<input name="a" type="button" value="open2" onClick="open2()">
</form>
</body>b.html<script>
function guanbi(){
window.opener.form.ProductImage.value = document.form1.aa.value;
alert(document.form1.aa.value);
window.close();
}
</script>
<body>
<form name="form1"action="" method="get">
<input name="aa" type="text">
<input name="a" type="button" value="closed" onClick="guanbi()">
</form>
</body>请哪个高人帮我看下哪里错了。
<script>
function guanbi(){
window.opener.form2.aa.value = document.form1.aa.value;
alert(window.opener.form2.aa.value);
window.opener=null;
window.close();
}
</script>
<body>
<form name="form1"action="" method="get">
<input name="aa" type="text">
<input name="a" type="button" value="closed" onClick="guanbi()">
</form>
</body>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function setValue(){
document.Form1.txt1.value= "changed" ;
newoption = new Option("changed","changed");
document.Form1.sel1.add(newoption);
}function openWin(){ objWin = window.open('','');
objWin.document.open();
objWin.document.write ("<body bgcolor=#cccccc></body>");
objWin.document.write ("<input type='button' value='SetValue' onclick='opener.setValue();window.opener=null;window.close()'>");
objWin.document.write ("<input type='button' value='CloseMe' onclick='if(opener.closed){window.opener=null;window.close()}'>");
objWin.document.close;
}
//-->
</SCRIPT>
</HEAD><BODY>
<FORM name="Form1" METHOD=POST ACTION="">
<INPUT TYPE="text" NAME="txt1" value="default">
<INPUT TYPE="button" NAME="abc" onclick="openWin()" value="openWin">
<select name="sel1"></select>
</FORM>
</BODY>