opener.show();

父窗体需要顶一个show() 方法

父面页代码:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD LEVEL1//EN">
<html><head><title>html.html</title><meta http-equiv="keywords" content="keyword1,keyword2,keyword3"><meta http-equiv="description" content="this is my page"><meta http-equiv="content-type" content="text/html; charset=UTF-8"><!--<link rel="stylesheet" type="text/css" href="./styles.css">--></head><body><div><button id="btn">open new page</button></div><script>window.οnlοad=function(){var btn = document.getElementById("btn");btn.onclick = openPage;function openPage(){try {window.open('newpage.html');  }catch(e){alert(e);}//alert("ok");}}function show(){document.title=new Date();}</script></body>
</html>

newpage.html 代码 需要打开的页面

<!DOCTYPE HTML PUBLIC "-//IETF//DTD LEVEL1//EN">
<html><head><title>newpage.html</title><meta http-equiv="keywords" content="keyword1,keyword2,keyword3"><meta http-equiv="description" content="this is my page"><meta http-equiv="content-type" content="text/html; charset=UTF-8"><!--<link rel="stylesheet" type="text/css" href="./styles.css">--></head><body><button id="btn" οnclick="fun()">单击</button><script>function fun(){opener.show();}</script></body>
</html>

转载于:https://www.cnblogs.com/jiangu66/p/3192257.html

js 调用父窗口的方法相关推荐

  1. window.open window.showModelDialog 打开一个新窗口/子窗口中调用父窗口的方法

    window.open 只打开一个窗口是将 oNewWindow   =   window   .   open   (   sURL   ,   sName   ,   sFeatures   , ...

  2. JS实现关闭当前子窗口,刷新父窗口及调用父窗口的方法

    一.JS实现关闭当前子窗口,刷新父窗口 JS代码如下: <script>  function refreshParent() {   window.opener.location.href ...

  3. 2分钟通过javascript的opener方式实现调用父窗口方法示例

    父窗口的JS代码: // 打开上传文件窗口 function uploadImgFile(id){ // open里面的参数详情,查看MDN,更系统的详情资源window.open("${b ...

  4. javascript调用父窗口(父页面)的方法

    window.parent与window.opener的区别 javascript调用主窗口方法 1:   window.parent 是iframe页面调用父页面对象 举例: a.html Html ...

  5. 在框架内用top.layer.open方式打开的子窗口中调用父窗口方法

    1.父窗口方法 function add() { //相关语句 } 2.父窗口打开子窗口 ,其他属性设置参考layer API top.layer.open({ id: "父窗口ID&quo ...

  6. JS 打开新窗口的方法

    一.window.open()支持环境:JavaScript1.0+/JScript1.0+/Nav2+/IE3+/Opera3+ 二.基本语法:window.open(pageURL,name,pa ...

  7. C# 在子窗体中调用父窗体的方法

    C# 在子窗体中调用父窗体的方法 在改软件的时候碰上一个非常麻烦的问题,查了好久才顺利解决 具体方法参考了 https://blog.csdn.net/lz00728/article/details/ ...

  8. angularjs2--tab页调用父页面的方法

    angularjs2–tab页调用父页面的方法 问题情景:页面A中使用window.open()打开新的tab页B,在页面B中想调用A中的方法.比如,在画面B中做了一些改变数据的操作,想在B关闭时候, ...

  9. Android开发中调用系统窗口的方法

    //直接拨号 Intent callIntent = new Intent(Intent.ACTION_CALL,Uri.parse("tel:12345678")); start ...

最新文章

  1. 使用OpenCV进行直播(附代码)
  2. 让Redis在你的系统中发挥更大作用
  3. 《转》IIS中配置通配符应用程序映射
  4. 异常信息配置文件已被另一个程序更改_抢先目睹:SpringBoot2.4配置文件加载机制大变化
  5. 云炬WEB开发笔记2-5 chrome调试工具
  6. dwz框架中动态添加查找带回组件
  7. Android学习网站
  8. 104. 字符串函数
  9. HTML5 简介与安装
  10. Windows 7 镜像下载汇总
  11. Excel VBA 函数返回值
  12. 使用CASEWHEN批量拼凑Update语句
  13. 中国住户调查年鉴(2000-2021年)
  14. 怎样在命令行下检测和清除恶意软件
  15. 打开计算机显示远程控制,win7系统远程协助怎么打开?开启远程协助功能教程...
  16. 浅谈智慧校园建设中存在的问题及解决方案
  17. 国内科技巨头的区块链布局:BAT多领域布局,迅雷领跑主链
  18. iOS为什么获取不到设备的DeviceToken
  19. 过滤器(1)_什么是过滤器?
  20. 农夫 狼 羊 白菜 java,农夫、狼、羊、白菜(回溯法求解)

热门文章

  1. 基于朴素贝叶斯分类器的西瓜数据集 2.0 预测分类_机器学习之朴素贝叶斯
  2. ps抠头发插件_「福利」PS抠图神级插件——VertusFluid Mask
  3. AtCoder AGC002F Leftmost Ball (DP、组合计数)
  4. UOJ #214 [UNR #1]合唱队形 (概率期望计数、DP、Min-Max容斥)
  5. android textview 文字居中_Android布局优化,看这3点就够了
  6. Django 执行 makemigrations 显示 No changes detected in app
  7. C#泛谈 —— 变体(协变/逆变)
  8. 解决Visual Studio 找不到报表控件、rdlc中文乱码
  9. 有关logistic(sigmoid)函数回归
  10. OAuth2.0学习(1-1)OAuth2.0是什么?