不用jquery,直接在子窗体中用window.opener.forms[0].xxx.value;就可以了
解决方案 »
- struts2+spring+Hibernate项目发布
- Struts2零配置:使用注释的方式如何为Action指定拦截器
- Collection 的方法请高手解决!!!!
- hibernate 表关联的问题!急!!!
- 中文乱码问题
- 出售一大型.NET OA源码 VB.NET+SQL SERVER
- gcc命令的使用
- 急问!关于J2EE项目的测试!100分在线等!
- Io 异常: The Network Adapter could not establish the connection
- 高手一定要看:ejb与ejb互相调用的问题
- 如何用Java实现rss,求源代码
- 双向一对多中 fetch="join" 和 query.list() 一起用时导致的问题
alert(products.html());
但是弹出的值为null
也就是 id="tb_products tbody" 才可以获取到
如:
在父窗体有一个这样的标签<div id="dd">Demo</div>在子窗体中可以这样获取他的值
var value=$(window.parent.document).find("#dd")
alert(value.html());弹出值为Demo
<html>
<head>
<script>
function show()
{
return window.showModalDialog("test2.htm",this, "DialogWidth:450px;DialogHeight:450px;help:no;status:no");
}
</script>
</head>
<body>
<div id="div1">父窗体的DIV1</div>
<div id="div2">父窗体的DIV2</div>
<div id="div3">父窗体的DIV3</div>
<div id="div4">父窗体的DIV4</div>
<Input type="button" value="弹出子窗体" onclick="show()"/>
</body></html>子窗体代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<script>
function Get()
{
var parentWindow=window.dialogArguments; alert( parentWindow.document.getElementById("div1").innerText);
alert( parentWindow.document.getElementById("div2").innerText);
alert( parentWindow.document.getElementById("div3").innerText);
alert( parentWindow.document.getElementById("div4").innerText);
}
</script>
</head>
<body>
<Input type="button" value="获取父窗体对象" onclick="Get()"/>
</body>
</html>