iframe跨源报错:"Blocked a frame with origin from accessing a cross-origin frame"
一、报错信息:
“Blocked a frame with origin from accessing a cross-origin frame”
二、在stackoverflow上找到原因
Same-origin security policy You can't access an <iframe> with Javascript, it would be a huge security flaw if you could do it. For the same-origin policy browsers block scripts trying to access a frame with a different origin. (同源策略) Origin is considered different if at least one of the following parts of the address isn't maintained: <protocol>://<hostname>:<port>/path/to/page.html Protocol(协议), hostname(主机名) and port(端口) must be the same of your domain, if you want to access a frame.
iframe调用父页面的函数:parent.functionNme();
ps:如果报以上错误,把iframe和父页面代码都放入工程项目中在本地跑起来即可解决同源问题。
iframe跨源报错:"Blocked a frame with origin from accessing a cross-origin frame"的更多相关文章
- iframe跨端口报错 Blocked a frame with origin from accessing a cross-origin frame
前言 在不同的端口号,甚至是不同的ip进行iframe嵌套的时候,在父页面调用子页面的方法的时候,报错 SecurityError: Blocked a frame with origin fr ...
- canvas.toDataURL 由于跨域报错的解决方法
关于canvas.toDataURL 由于跨域报错的解决方法 用过canvas,都知道toDataURL这个方法真好用,不仅合成图片用到它,压缩图片也用到它.但有一个问题,就是图片源不能跨域,不然会报 ...
- 编译安装常用包+阿里镜像源-常用资源-系统-下载-科莱软件下载-docker仓库包-安全圈-杏雨梨云-图形界面安装-docker私有双仓库-阿里源报错处理-centos7目录大小
yum install apr-util apr-util-devel apr apr-devel pcre pcre-devel zlib zlib-devel openssl openssl-de ...
- ie9/8的iframe中jQuery报错
此文章用于对工作中遇到的问题进行记录 jQuery 版本:1.9.1 按照一般的思路,jquery 1.x的是支持ie9及以下的,但是今天发现jquery报错了,代码错误位置在源码版本的第4888行 ...
- 163源报错Hash Sum mismatch 解决方法
Ubuntu server 用的163的源,报错: W: Failed to fetch http://mirrors.163.com/ubuntu/dists/precise-updates/mai ...
- linux -小记(3) 问题:linux 安装epel扩展源报错
EPEL提供的软件包大多基于其对应的Fedora软件包,不会与企业版Linux发行版本的软件发生冲突或替换其文件. epel安装对应的rpm包 centos5 32位epel源下载地址: www.li ...
- Access to Image at 'file:///Users canvas本地图片跨域报错解决方案
1.设置跨域 添加跨域条件 crossorigin="anonymous" 前提是后端支持这个图片跨域 2.上面加了之后还是报错 如标题所示 你需要把你的项目放到服务器上面跑 ...
- centos7 升级php7 添加配置epel源 报错:Cannot retrieve metalink for repository: epel. Please verify its path and try again
文章来自:循序渐渐linux:基础知识 一书 7.3章LAMP服务器搭建 日常故障 centos上好多软件升级需要配置epel源 其中有一点小插曲 需要手动更改 1.很多时候,对PHP环境要求较新的版 ...
- manjaro软件源报错 不停看到错误 "PackageName: signature from "User <email@archlinux.org>" is invalid" 的几种解决方法
对于报错情况, 格式大致如下: error: PackageName: signature from "User <email@archlinux.org>" is i ...
随机推荐
- WKWebView 里 JS 和 native 通信的例子
native 端 初始化 wkwebview,设置 message handler webView = WKWebView.init() let usecc = self.webView.config ...
- 中国云运营商横向对比——IaaS服务对标
前言: 随着互联网行业的快速发展,云服务器的使用越来越普遍.中国的云服务器提供商数量也在增加,市场上有大大小小多家云服务器提供商.然而,为了在众多服务提供商中脱颖而出,国内云服务器运营商商也在不断的利 ...
- 【bzoj3684】 大朋友和多叉树 生成函数+多项式快速幂+拉格朗日反演
这题一看就觉得是生成函数的题... 我们不妨去推下此题的生成函数,设生成函数为$F(x)$,则$[x^s]F(x)$即为答案. 根据题意,我们得到 $F(x)=x+\sum_{i∈D} F^i(x)$ ...
- (转)防止人为误操作MySQL数据库技巧一例
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://oldboy.blog.51cto.com/2561410/1321061 防止人 ...
- Java之集合(二)ArrayDeque
转载请注明源出处:http://www.cnblogs.com/lighten/p/7283928.html 1.前言 上章讲解了Java中的集合接口和相关实现抽象类,本章开始介绍一些具体的实现类,第 ...
- 【链表】 Reverse Linked List II
题目: Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1- ...
- Flow类中的resolveBreaks与resolveContinues
/** Resolve all continues of this statement. */ boolean resolveContinues(JCTree tree) { boolean resu ...
- 术语CDATA,其实可以理解为一种特殊的转移字符
参考:http://www.w3school.com.cn/xml/xml_cdata.asp 常见于XML文档,所有 XML 文档中的文本均会被解析器解析. 只有 CDATA 区段(Charact ...
- 我的zsh 配置
# If you come from bash you might have to change your $PATH.# ZSH的环境变量export ZSH=/Users/lorialex/.oh ...
- lucene源码分析(1)基本要素
1.源码包 core: Lucene core library analyzers-common: Analyzers for indexing content in different langua ...