window.open和window.showModalDialog
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的更多相关文章
- JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作
一.Iframe 篇 公共部分 //父对象得到子窗口的值 //ObjectID是窗口标识,ContentID是元素ID function GetValue(ObjectID,ContentID) { ...
- 总结JavaScript(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作
一.Iframe 篇 //&&&&&&&&&&&&&&&&&&a ...
- 总结js(Iframe、window.open、window.showModalDialog)父窗口与子窗口之间的操作
http://hi.baidu.com/yashua839/blog/item/131fdb2fe547ef221f3089af.html一.Iframe 篇 //&&&&am ...
- window.open()与window.showModalDialog区别
window.open()与window.showModalDialog区别 弹出窗口两种方式: 1.window.showModalDialog: var feature = &qu ...
- window.open、window.showModalDialog和window.showModelessDialog 的区别[转]
一.前言 要打开一个可以载入页面的子窗口有三种方法,分别是window.open.window.showModalDialog和window.showModelessDialog. open方法就是打 ...
- window.parent与window.opener、window.showModalDialog的区别 opener和showModalDialog刷新父页面的方法
项目中使用案例: 父窗体 <s:form namespace="/forexagent" id="listSearchForm" name="t ...
- (转)window.open和window.showModalDialog的区别
window.open和window.showModalDialog区别: 1.都是在IE上打开新窗口,只不过前者是非阻塞式,也可以说非模态窗口.而后者是阻塞式模态窗口.阻塞或者模态窗口,只有你把当前 ...
- window.parent与window.openner区别介绍
今天总结一下js中几个对象的区别和用法: 首先来说说 parent.window与top.window的用法 "window.location.href"."locati ...
- window.onload和window.document.readystate的探究
在编写前端页面的时候,我们时常需要对页面加载的状态进行判断,以便进行相应的操作. 比如在移动端,时常需要在页面完全加载完成之前,先显示一个loading的图标,等待页面完成加载完成后,才显示出真正要展 ...
- window.location.href = window.location.href 跳转无反应 a 超链接 onclick 点击跳转无反应
错误写法 , 主要是在 href="#"这里 <a href="#" id="send" onclick="return b ...
随机推荐
- Post Office Protocol --- pop协议
https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
- Android电话拨号器_06
在Android模拟器中开发时,有时需要模拟拨打电话功能,由于模拟器不能直接当做真机使用,所以我们需要再模拟器中模拟真机拨打电话,首先需要创建两个模拟器,当做两部Android手机来使用.由于Andr ...
- Thinkphp 验证码点击刷新解决办法
HTML代码如下: <span> <input type="text" name="code" placeholder="验证码&q ...
- AJAX之三种数据传输格式详解
一.HTML HTML由一些普通文本组成.如果服务器通过XMLHTTPRequest发送HTML,文本将存储在responseText属性中. 从服务器端发送的HTML的代码在浏览器端不需要用Java ...
- 8.26 js
2018-8-26 20:35:53 这两天周末,一直在看苏东坡传! 明天正常学python 用心学!
- ActiveMQ延迟消息配置
ActiveMQ使用延迟消息,需要在activemq.xml配置文件中添加这项: schedulerSupport="true" <broker xmlns="ht ...
- hdu 1525 Euclid's Game【 博弈论】
Two players, Stan and Ollie, play, starting with two natural numbers. Stan, the first player, subtra ...
- TOP100summit 2017:投资千亿成立达摩院,揭秘阿里在人工智能领域的探索
今天上午,阿里巴巴云栖大会在杭州开幕,第一条重磅消息是阿里首席技术官张建锋宣布成立达摩院,在全球各地建立实验室,3年内投入千亿在全球建立实验室.和高校建立研究所.建立全球研究中心等事务. 该院由全球实 ...
- POJ 1556 - The Doors - [平面几何+建图spfa最短路]
题目链接:http://poj.org/problem?id=1556 Time Limit: 1000MS Memory Limit: 10000K Description You are to f ...
- iOS UITextField实时监听获取输入内容,中文状态去除预输入拼音
http://blog.csdn.net/cse110/article/details/51360796 - (void)textFieldDidChange:(UITextField *)textF ...