window.open

window.open是打开一个新窗口

 在window.open打开的窗口中刷新父页面 opener.location.reload();

打开一个窗口格式:属性可以任意设置

var salesWindow = window.open("/PageTemplate/Sales/AddSales.aspx?key=key&title=add", "窗口标题", 'height=' + iHeight + ', width=' + iWidth + ', toolbar=no,menubar=no,scrollbars=yes,resizeable=no,location=no,status=no,top=' + iTop + ',left=' + iLeft + '');

但我们把打开的窗口最小化后。再次点击窗口希望把之前的窗口打开。可以这样

//当前窗口已经存在
              if (salesWindow && !salesWindow.closed) {
                  salesWindow.focus(); //当前窗口最小化的时候。这样会弹出
                  return;
              }

在window.open打开的窗口中获取父页面的元素

比如 父页面的元素  <input type="hidden" name="name" value="8787"  id="yy"/>

语法:

jquery:     var pa = $("#yy", window.opener.document).val();
            alert(pa);
js:         alert(window.opener.document.getElementById("yy").value);

window.showModalDialog 是打开一个模态窗口

  同理:

var reVal = window.showModalDialog("/PageTemplate/ColumnSetting.aspx?id=id", "传的参数", "dialogWidth=" + iWidth + ";dialogHeight=" + iHeight + ",status=no");

接收父窗口传的值:我这里说的不是路径后面的值  而是 "传的参数部分"  则这样接收:var obj = window.dialogArguments;

当然。路径后面的值你也可以得到。你得到href然后截取就可以。

在打开的窗口返回值给父窗口 window.returnValue = "传值给父窗口"; //设置返回父窗口的值

var kk = reVal; //这里接收了子窗口传回的值

window.open和window.showModalDialog的更多相关文章

  1. JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作

    一.Iframe 篇 公共部分 //父对象得到子窗口的值 //ObjectID是窗口标识,ContentID是元素ID function GetValue(ObjectID,ContentID) { ...

  2. 总结JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作

    一.Iframe 篇 //&&&&&&&&&&&&&&&&&&a ...

  3. 总结js(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作

    http://hi.baidu.com/yashua839/blog/item/131fdb2fe547ef221f3089af.html一.Iframe 篇 //&&&&am ...

  4. window.open()与window.showModalDialog区别

    window.open()与window.showModalDialog区别 弹出窗口两种方式:    1.window.showModalDialog:      var feature = &qu ...

  5. window.open、window.showModalDialog和window.showModelessDialog 的区别[转]

    一.前言 要打开一个可以载入页面的子窗口有三种方法,分别是window.open.window.showModalDialog和window.showModelessDialog. open方法就是打 ...

  6. window.parent与window.opener、window.showModalDialog的区别 opener和showModalDialog刷新父页面的方法

    项目中使用案例: 父窗体 <s:form namespace="/forexagent" id="listSearchForm" name="t ...

  7. (转)window.open和window.showModalDialog的区别

    window.open和window.showModalDialog区别: 1.都是在IE上打开新窗口,只不过前者是非阻塞式,也可以说非模态窗口.而后者是阻塞式模态窗口.阻塞或者模态窗口,只有你把当前 ...

  8. window.parent与window.openner区别介绍

    今天总结一下js中几个对象的区别和用法: 首先来说说 parent.window与top.window的用法 "window.location.href"."locati ...

  9. window.onload和window.document.readystate的探究

    在编写前端页面的时候,我们时常需要对页面加载的状态进行判断,以便进行相应的操作. 比如在移动端,时常需要在页面完全加载完成之前,先显示一个loading的图标,等待页面完成加载完成后,才显示出真正要展 ...

  10. window.location.href = window.location.href 跳转无反应 a 超链接 onclick 点击跳转无反应

    错误写法 , 主要是在 href="#"这里 <a href="#" id="send" onclick="return b ...

随机推荐

  1. C和C++书籍推荐

    http://bestcbooks.com/recommend/most-influential-book/ http://www.ruanyifeng.com/blog/2011/09/c_prog ...

  2. LeetCode 31 Next Permutation(下一个全排列)

    题目链接: https://leetcode.com/problems/next-permutation/?tab=Description   Problem :寻找给定int数组的下一个全排列(要求 ...

  3. vue生成路由实例, 使用单个vue文件模板生成路由

    一.vue-loader与vue-router配合 $ cnpm install vue-router --save 二.生成vue-webpack模板 $ vue init webpack-simp ...

  4. Centos 使用 docker

    公司linux服务器基本使用的Centos,以下切换为Centos进行docker的操作. 查看系统版本 [root@Sonar-104 ~]# cat /etc/redhat-release Cen ...

  5. Eui中eui.Image的source和texture属性赋值导致的获取高宽为0问题

    引擎5.2.5版本 一个eui.Image,给source和texture赋值,获取高宽会不同 = = ! let img:eui.Image = new eui.Image(); img.sourc ...

  6. [通信] C# TCP实现多个客户端与服务端 数据 与 文件的传输

    说明: http://download.csdn.net/detail/chwei_cson/4423874 源码: http://download.csdn.net/download/meicanj ...

  7. Git - 忽略Xcode工程中UserInterfaceState.xcuserstate文件的问题

    一.在同 .Git目录下创建.gitignore文件.在文件中加入如下内容: *.xcuserstate project.xcworkspace xcuserdata UserInterfaceSta ...

  8. iOS UIScrollView 3种分页方法,间隔实现

    基础知识参考 http://tech.glowing.com/cn/practice-in-uiscrollview/ https://stackoverflow.com/questions/9367 ...

  9. POJ 2318 - TOYS - [计算几何基础题]

    题目链接:http://poj.org/problem?id=2318 Time Limit: 2000MS Memory Limit: 65536K Description Calculate th ...

  10. HDU 4849 - Wow! Such City!

    Time Limit: 15000/8000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others)   Input There ar ...