如图,部门信息和机构列表两个window窗口,window窗口的函数是封装在框架的主页面的,这俩页面都是调用同一个window窗口的方法,两页面间不存在什么关系,我需要从机构列表取的值传到部门信息页面去,不知道如何传。
我的想法是在机构列表页面去调用部门信息页面的js方法,不知道怎么调用。页面是嵌套在iframe里的。
document.getElementById('windowIframe').contentWindow.ceshi() 这种方式不行。。
我的想法是在机构列表页面去调用部门信息页面的js方法,不知道怎么调用。页面是嵌套在iframe里的。
document.getElementById('windowIframe').contentWindow.ceshi() 这种方式不行。。
解决方案 »
- js方法调用问题
- JQ的POST请求时IE浏览器下出错:意外地调用了方法或属性访问 求解决方法。
- -_-!在线等,结帖出错!
- 从网上下的代码,其中有些看不懂,请各位大侠多多指教
- ~~~~~~~~~Jquery回车TAB顺序,马上给分~~~~~~~~~~~
- 鼠标在图片上选择一个框,这个框的起点与终占点的坐标?
- JavaScript里面引用HTML元素的问题
- 如何动态改变网页的刷新时间?
- 关于下载的问题!<object CLASSID="...." CODEBASE="....."></object>
- 有誰知道如何讀取網頁中TextBox中的當前光標位置..急(100分相送)
- 鼠标滚轮效果
- 求教怎么在easyUI的扩展编辑器editor里增加参数传递到后台?[急!跪求!]
parentDialog.html:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="../JS/jquery-easyui-1.4/themes/gray/easyui.css" rel="stylesheet" />
</head>
<body>
<iframe src="callParentDialog.html" style="width: 300px; height: 200px; border: 1px green solid;"></iframe>
<div style="display: none;">
<div id="dialog">
<input id="test" type="text" value="这里的值将传回去" />
<div id="ddd"><!--这里将接收子页面过来的控件--></div>
</div>
</div>
</body>
</html>
<script src="../JS/jquery-easyui-1.4/jquery.min.js"></script>
<script src="../JS/jquery-easyui-1.4/jquery.easyui.min.js"></script>
<script type="text/javascript">
function openDialog(callback, setText, container) {
$('#ddd').append(setText);//将子页面的控件附加到对话框里面
$('#dialog').dialog({
title: '弹窗示例,关闭后回写数据',
onClose: function () {
//这里回传一个对象回去,也可以传单个的值啥的
callback({ returnValue: document.getElementById('test').value });
//setText.value = "从父页面回写子页面对象";
$(container).append(setText);
},
modal:true
});
}
</script>callParentDialog.html:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<input type="button" value="打开窗体" onclick="openDig();" /><br />
接收后回写值:<input id="ret" type="text" /><br />
父页面写入值:<span id="sss"><input id="getText" type="text" value="这个是子页面的控件" /></span>
</body>
</html>
<script type="text/javascript">
function openDig() {
parent.openDialog(function (v) {
document.getElementById('ret').value = v.returnValue;
}, document.getElementById('getText')
, document.getElementById('sss'));
}
</script>