javascript父窗口与子窗口通信
在父窗口的js代码
//回调的函数
function alt(temp){
alert(temp);
};
$("#Btn").click(function (obj) {
//声明子窗口触发的方法;
window.returnCallBackValue354865588 = alt;
//打开新的窗口
window.open(str, "roleSelect", 'height=300,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizeable=no,location=no,status=no');
});
子窗口的js代码:
//子窗口的按钮 点击之后关闭当前子窗口页面,并到打开的父页面中触发绑定的回调方法;
$("#submitBtn").click(function () {
//第二个参数是要返回的数据。
window.opener.returnCallBackValue354865588.call(window.opener, "qwe");
window.close();
});
在chrome下测试 可以使用,ie下可以使用showModalDialog方法。
javascript父窗口与子窗口通信的更多相关文章
- JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作
一.Iframe 篇 公共部分 //父对象得到子窗口的值 //ObjectID是窗口标识,ContentID是元素ID function GetValue(ObjectID,ContentID) { ...
- 总结JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作
一.Iframe 篇 //&&&&&&&&&&&&&&&&&&a ...
- js window.open() 父窗口与子窗口的互相调用(未必有用)
javascript 父窗口与子窗口的互相调用 <html> <head></head> <body> 主要实现父子关系的页面 window.opene ...
- #js window.open() 父窗口与子窗口的互相调用【转】
未完整版 javascript 父窗口与子窗口的互相调用 a.html 父页面 <HTML> <HEAD> <meta http-equiv="content- ...
- HTML中IFrame父窗口与子窗口相互操作
一.Iframe篇 //&&&&&&&&&&&&&&&&&&am ...
- windows窗口分析,父窗口,子窗口,所有者窗口
(本文尝试通过一些简单的实验,来分析Windows的窗口机制,并对微软的设计理由进行一定的猜测,需要读者具备C++.Windows编程及MFC经验,还得有一定动手能力.文中可能出现一些术语不统一的现象 ...
- iframe父窗口和子窗口之间的调用
1>父窗口获取子窗口 js方法 document.getElementById('if1').contentWindow.document: window.frames["if1&qu ...
- 总结js(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作
http://hi.baidu.com/yashua839/blog/item/131fdb2fe547ef221f3089af.html一.Iframe 篇 //&&&&am ...
- iframe父窗口和子窗口的调用方法
iframe 父窗口和子窗口的调用方法父窗口调用子窗口 iframe_name.iframe_document_object.object_attribute = attribute_value 例子 ...
- windows 编程 —— 子窗口 与 子窗口控件
目录: 子窗口与主窗口的交互 子窗口控件 按钮类别 button 滚动条类别 scrollbar 静态类别 static 编辑框类别 edit 清单方块 listbox 子窗口与主窗口的交互 创建窗 ...
随机推荐
- struts2 MessageStoreInterceptor 拦截器的使用
MessageStoreInterceptor 拦截器可以把和该 Action 相关的 messages, errors 和 field errors(下称 "消息") 保存到 s ...
- jquery的Post方法$.post()
$.post是jquery自带的一个方法,使用前需要引入jquery.js 语法:$.post(url,data,callback,type); url(必须):发送请求的地址,String类型 da ...
- C#设置按钮三态背景图片
1.闪电事件,注意添加手动或者点击按钮->属性中的闪电->下面对应各种事件 在上面: private void button1_MouseHover(object sender, Even ...
- phpwind 去除init.phpwind.net统计功能
修改的文件如下:global.phplib/staticpage.class.phprequire/template.phpsimple/index.php
- a foreign key constraint fails
今天遇到一个问题,一对一级联保存时,报错如下: Cannot add or update a child row: a foreign key constraint fails 解决方法: MySQL ...
- sqlserver2008 case when then else end
在写sql语句的时候,有时候我们需要对字段的只进行判断计算.查看了下相关文档在sql2012.sql2014里边可以使用 IIF 函数直接完成. 但是现在我需要在sql2008版本中完成最字段的计算 ...
- Scala学习笔记--List、ListBuffer
ListBuffer(列表缓冲) ListBuffer类位于 scala.collection.mutable.ListBuffer val buf = new ListBuffer[Int] va ...
- jquery实现当前页面编辑
实现效果 代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://ww ...
- c# 大量拼接xml时内存溢出解决方法
public static string SelectUNnormalPriceSTrans(EUNnormalPriceS rqInfo) { string guidStrJianJclFirst ...
- 关appid
https://code.google.com/p/goagent/wiki/InstallGuide 申请appid