请帮忙看看能不能实现这样的效果 to:dodo请告诉我应该怎么写好吗?我找了很多的资料,基本上都是这么写的呀! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>新建网页 1</title></head><body> <p><select size="8" id="txt"> </select></p><input type="button" onclick="window.open('in.htm')" value="Open"></body></html>第二页<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>新建网页 1</title></head><script>function CloseOpen() { //opener.document.all.txt.options.add(new Option('华南地区','12')); opener.document.all.txt.length=opener.document.all.txt.length+1; opener.document.all.txt.options[opener.document.all.txt.length-1].text="华南地区"; opener.document.all.txt.options[opener.document.all.txt.length-1].value="12"; window.close();}</script><body onunload=""><p><input type="button" onclick="javascript:CloseOpen();" value="close"></p></body></html> 一. 父窗口:<form name=form1><select name=parentList><option>请选择</select></form>子窗口:<select onchange="writeParentList(this.value)"><option>请选择<option value=aaa>aaa<option value=bbb>bbb<option value=ccc>ccc<option value=ddd>ddd<option value=eee>eee</select><script language=javascript>function writeParentList(str){ if(top==window) return; //若该页没有被 frame 则跳出 if(str=="") return; if(parent.document.form1.parentList) { e = parent.document.form1.parentList; var newOP=new Option(str, str, true, true); for(var i=0; i<e.options.length; i++) //不重复 if(e.options[i].value == str) return; e.options[e.options.length] = newOP; }}</script>二. opener有关系:父窗口:<form name=form1><select name=parentList><option>请选择</select></form><script language=javascript>function writeParentList(str){ if(str=="") return; if(document.form1.parentList) { e = document.form1.parentList; var newOP=new Option(str, str, true, true); for(var i=0; i<e.options.length; i++) //不重复 if(e.options[i].value == str) return; e.options[e.options.length] = newOP; }}</script><input type=button value=ok onclick="window.open('ttt.htm','meizz')">子窗口:<select onchange="if(window.name!='')opener.writeParentList(this.value)"><option>请选择<option value=aaa>aaa<option value=bbb>bbb<option value=ccc>ccc<option value=ddd>ddd<option value=eee>eee</select> json 该怎么组织 JQuery操作表格在IE下无法显示。 hibernate跟struts的关系 点击图片上下移动固定位置! HTML控件怎么来实现上传图片的预览效果 真的是跪求了,关于JavaScript的三级联动的下拉框的代码的 如何利用鼠标的滑轮控制图片的放大与缩小? ■■高分请教:网页中表单的删除操作。■■ 急!我想实现这样的菜单 在 html中有没有只定时刷新一个页面中的部分页面的功能?? 如何判断一个输入是否是合法数字 请问JAVASCRIPT中连接SQLSERVER数据库的语句应该如何写?
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head><body> <p><select size="8" id="txt">
</select></p><input type="button" onclick="window.open('in.htm')" value="Open">
</body></html>第二页
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head><script>
function CloseOpen() {
//opener.document.all.txt.options.add(new Option('华南地区','12'));
opener.document.all.txt.length=opener.document.all.txt.length+1;
opener.document.all.txt.options[opener.document.all.txt.length-1].text="华南地区";
opener.document.all.txt.options[opener.document.all.txt.length-1].value="12";
window.close();
}
</script>
<body onunload="">
<p><input type="button" onclick="javascript:CloseOpen();" value="close"></p>
</body></html>
<form name=form1>
<select name=parentList>
<option>请选择
</select>
</form>子窗口:
<select onchange="writeParentList(this.value)">
<option>请选择
<option value=aaa>aaa
<option value=bbb>bbb
<option value=ccc>ccc
<option value=ddd>ddd
<option value=eee>eee
</select><script language=javascript>
function writeParentList(str)
{
if(top==window) return; //若该页没有被 frame 则跳出
if(str=="") return;
if(parent.document.form1.parentList)
{
e = parent.document.form1.parentList;
var newOP=new Option(str, str, true, true);
for(var i=0; i<e.options.length; i++) //不重复
if(e.options[i].value == str) return;
e.options[e.options.length] = newOP;
}
}
</script>
二. opener有关系:父窗口:
<form name=form1>
<select name=parentList>
<option>请选择
</select>
</form>
<script language=javascript>
function writeParentList(str)
{
if(str=="") return;
if(document.form1.parentList)
{
e = document.form1.parentList;
var newOP=new Option(str, str, true, true);
for(var i=0; i<e.options.length; i++) //不重复
if(e.options[i].value == str) return;
e.options[e.options.length] = newOP;
}
}
</script><input type=button value=ok onclick="window.open('ttt.htm','meizz')">
子窗口:
<select onchange="if(window.name!='')opener.writeParentList(this.value)">
<option>请选择
<option value=aaa>aaa
<option value=bbb>bbb
<option value=ccc>ccc
<option value=ddd>ddd
<option value=eee>eee
</select>