页面A,为父页面
调用 GetDate()方法打开pop.html
function GetDate(){
window.showModalDialog("pop.html", '',"status:no;center:yes;scroll:no;resizable:no;help:no;dialogWidth:300px;dialogHeight:310px");
}在pop.html里面,有个iframe,调用到sub_pop.html
<body style="overflow-x:hidden;overflow-y:hidden">
<iFrame src="sub_pop.html" border=0 frameborder=0 height=100% style="overflow-x:hidden;overflow-y:hidden" />
</body> 在sub_pop.html 中有个按钮事件,请问
在这个iframe里面如何给父页面A中的某个text控件赋值???
调用 GetDate()方法打开pop.html
function GetDate(){
window.showModalDialog("pop.html", '',"status:no;center:yes;scroll:no;resizable:no;help:no;dialogWidth:300px;dialogHeight:310px");
}在pop.html里面,有个iframe,调用到sub_pop.html
<body style="overflow-x:hidden;overflow-y:hidden">
<iFrame src="sub_pop.html" border=0 frameborder=0 height=100% style="overflow-x:hidden;overflow-y:hidden" />
</body> 在sub_pop.html 中有个按钮事件,请问
在这个iframe里面如何给父页面A中的某个text控件赋值???
解决方案 »
- j2ee基础知识问题与答案,面试经常问到
- java调用SQL2005存储过程报错
- 在查询结果中取10个字,看看哪里错了?
- 如何改变JBUILDER2006的执行顺序
- jsp中while(rs.next())问题
- 请教高手::怎么解决<a href=""?>后面参数乱吗问题?
- 急问数据库(初学者)
- 静态页面与springmvc拦截模式一样怎么让静态优先
- 现在用JSP开发Web应用的模式是否只有两种啊(JSP+JavaBean+Servlet和JSP+JavaBean)?
- 一個OA類系統,servlet實現的,需要Applet支持,踢踢意見。
- jsp数据库简单问题
- STRUTS2下载远程机器上的文件
<script type="text/javascript">
function GetDate(){
var a_text = document.getElementById("a_text");
window.showModalDialog("pop.html", a_text, "status:no;center:yes;scroll:no;resizable:no;help:no;dialogWidth:300px;dialogHeight:310px");
}
</script>
<body>
<input type="text" id="a_text"/>
<input type="button" onclick="GetDate()" value="getDate"/>
</body>
</html>pop.html<html>
<body>
<iframe src="sub_pop.html">
</iframe>
</body>
</html>
sub_pop.html<html>
<script type="text/javascript">
function setAValue(){
parent.window.dialogArguments.value="好了,给分吧!";
}
</script>
<body>
<input type="button" onclick="setAValue()" value="设值"/>
</body>
</html>
1、获取父窗口的引用
2、返回字符串给父窗口
javascript基本上不会
<html>
<script type="text/javascript">
function GetDate(){
var a_text = document.getElementById("a_text");
window.open("pop.html");
}
</script>
<body>
<input type="text" id="a_text"/>
<input type="button" onclick="GetDate()" value="getDate"/>
</body>
</html>sub_pop.html<html>
<script type="text/javascript">
function setAValue(){
var openDoc = parent.opener.document;
openDoc.getElementById("a_text").value="结贴了!";
}
</script>
<body>
<input type="button" onclick="setAValue()" value="设值"/>
</body>
</html>
前辈你好 我也遇到了这个问题 parent.window.dialogArguments.value? 谁的value?
如果我只是想单独的给父窗口的某一个控件赋值呢?
比如我给父窗口的<input type="text" id="name" name="name" />赋值怎么办?
var codeid=jQuery(i).parent().parent().find("td").eq(1).html();
codeid=codeid.substring(0,codeid.length-1);
var codename=jQuery(i).parent().parent().find("td").eq(2).html();
codename=codename.substring(0,codename.length-1);
window.opener.jQuery("#tbb tr").find("input[name=codename][value='']").each(function(n,b){
jQuery(b).parent().parent().find("input").eq(1).val(codeid);
jQuery(b).parent().parent().find("input").eq(2).val(codename);
return false;
});
}); 这是子窗体操作父窗体 子窗体值给父窗体