how to disabled iframe page open new window / new tab

禁用 iframe 中的页面打开新页面


<!DOCTYPE html>
<html lang="zh-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="author" content="xgqfrms">
<meta name="generator" content="VS code">
<title>iframe bug</title>
</head>
<body>
<section>
<h1></h1>
<iframe src ="https://news.sina.com.cn/c/2019-01-23/doc-ihqfskcn9805649.shtml" style="border: 1px solid red;" height="500" width="600" align="top" frameborder=0 scrolling=no>
<p>Your browser does not support iframes.</p>
</iframe>
<iframe src ="https://news.sina.com.cn/c/2019-01-23/doc-ihqfskcn9805649.shtml" style="border: 1px solid red;" height="500" width="600">
<p>Your browser does not support iframes.</p>
</iframe>
</section>
</body>
</html>

DD-EAPP

https://stackoverflow.com/questions/29188009/how-to-prevent-links-in-iframe-from-opening-in-new-tab#

demo

https://codepen.io/webgeeker/pen/bzdbmK

https://codepen.io/webgeeker/pen/mvJbzM


<!DOCTYPE html>
<html lang="zh-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="author" content="xgqfrms">
<meta name="generator" content="VS code">
<title>auto return to home page!</title>
</head>
<body>
<section>
<h1>auto return to home page!</h1>
<section>
<pre>target="_blank"</pre>
<a href="https://cdn.xgqfrms.xyz/index.html" target="_blank">https://cdn.xgqfrms.xyz/index.html</a>
</section>
<section>
<pre>target="_parent"</pre>
<a href="https://cdn.xgqfrms.xyz/index.html" target="_parent">https://cdn.xgqfrms.xyz/index.html</a>
</section>
<section>
<pre>target="_self"</pre>
<a href="https://cdn.xgqfrms.xyz/index.html" target="_self">https://cdn.xgqfrms.xyz/index.html</a>
</section>
</section>
</body>
</html>

reasons

https://www.w3schools.com/tags/att_a_target.asp

https://css-tricks.com/snippets/html/form-submission-new-window/


<a href="#" target="_blank">link</a> <form action="#" method="post" target="_blank">
...
</form>


iframe & HTTPS & CORS

https://iframe.xgqfrms.xyz/eapp/index.html#blog.sina.cn

how to disabled iframe page open new window / new tab的更多相关文章

  1. how to insert js to iframe page in order to disabled open new page/window

    how to insert js to iframe page in order to disabled open new page/window js 禁用 iframe 中的页面打开新页面 htt ...

  2. easyUI的window包含一个iframe,在iframe中如何关闭window?

    easyUI的window包含一个iframe,在iframe中如何关闭window? parent.$('#win').window('close');

  3. JFace dailog button事件中刷新透视图异常 Trying to execute the disabled command org.eclipse.ui.window.closePerspective

    报错的代码为 protected void buttonPressed(int buttonId) { Display.getDefault().syncExec(new Runnable() { p ...

  4. EasyUI-window包含一个iframe,在iframe中如何关闭window

    我试过类似$('#win').window('close');报$.data...options无效的错误,我已经引入了js文件,路径没问题,而且在同一个页面,不用iframe是可以关闭的 在ifra ...

  5. WPF的Page介绍及Page Window Frame 之间的链接使用示例,嵌套问题

    本文源参考 http://www.cnblogs.com/ListenFly/archive/2013/02/24/2923474.html 谢谢源作者 WPF中的Page相比Window来说更加的精 ...

  6. HTML5 window/iframe跨域传递消息 API

    原文地址:HTML5′s window.postMessage API 在线示例:Using HTML5's window.postMessage(请打开控制台看日志) 原文日期: 2010年09月0 ...

  7. window.postMessage 跨窗口,跨iframe javascript 通信

    同源通信 执行它们的页面位于具有相同的协议(http/https),端口(80/443),主机(通常为域名) 时,这两个脚本才能相互通信 大多数情况下,网站就是内部的域名,所以是同源通信,可以相互访问 ...

  8. Personalize Oracle Applications Home Page Browser Window Title

    修改登录页 http://expertoracle.com/2016/03/10/personalizing-the-e-business-suite-r12-login-page/ STEP 2 : ...

  9. window.postMessage 在iframe父子页面数据传输

    介绍 https://developer.mozilla.org/zh-CN/docs/Web/API/Window/postMessage window.postMessage 发送方 接收方 示例 ...

随机推荐

  1. c# ajax从后台获取数据list数组 $.each再显示数据

    后台代码 public JsonResult linkage(string Department) {//逻辑是:先从数据库查到表数据 再把表数据转换为LIST给AJAX HE_Department ...

  2. 在腾讯ubuntu云服务器上面部署asp.net core 2.1网站

    微软以后的政策肯定是在开源和跨平台这一块,所以最近在学习asp.net core 2.1,查看市面上面大部分的把asp.net core部署在Linux后,决定亲自实验一番,不操作不知道,居然最新版本 ...

  3. 图片轮播,信手拈来(jquery)

    制作图片轮播,可以说是js或者jquery学习者应该掌握的技巧.但惭愧的是本菜之前一直一知半解,这回抽了半天多总结了下分享给大家.虽然标题比较吹牛,但目的是希望大家看了之后制作图片轮播会非常迅速. 首 ...

  4. IOS测试-Fastmonkey

    目录: 一.背景 二.Fastmonkey介绍 三.Fastmonkey操作前准备 四.Fastmonkey工程配置过程 五.执行Monkey测试 六.FAQ Fastmonkey实践 一.背景: 因 ...

  5. CentOS安装Zabbix Agent

    rpm -i http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm安装存储库 yum ...

  6. Centos6.8配置JDK

    下载jdk-版本号.tar.gz 解压到/usr/local/ vi /etc/profile 最后一行添加如下内容: export JAVA_HOME=/usr/local/jdk-版本号expor ...

  7. Shuffle Bags让你的随机不那么随机

    前言 当我最初写游戏时,我经常使用标准Random()函数,然后写一堆if和else条件来我获得预期结果.如果结果不太好,我会写更多的条件进行过滤或者筛选,直到我觉得游戏变得有趣.最近我发现有更好的方 ...

  8. Java子类初始化调用父类无参构造

    实在是服了自己,子类初始化调用父类无参构造这种初学者都应该知道的事,我给忘了. 记得当初看书的时候各种概念抄在笔记本上,再上机实践,以为一辈子都不会忘,还是给忘了. 这件事说明了两个问题: 1.我没有 ...

  9. 【读书笔记】《Computer Organization and Design: The Hardware/Software Interface》(1)

    笔记前言: <Computer Organization and Design: The Hardware/Software Interface>,中文译名,<计算机组成与设计:硬件 ...

  10. mysql以zip安装,解决the service already exists(转载)

    喵喵亲测可用: 转自:https://www.cnblogs.com/dichters/p/5929209.html mysql以zip安装, mysqld -install 报错:​The serv ...