一、报错信息:

  “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和父页面代码都放入工程项目中在本地跑起来即可解决同源问题。

原文链接:http://stackoverflow.com/questions/25098021/securityerror-blocked-a-frame-with-origin-from-accessing-a-cross-origin-frame

最新文章

  1. 【超级干货】手机移动端WEB资源整合
  2. Python 基礎 - 字符轉編碼操作
  3. 站在移动互联时代的十字路口上_deviceone
  4. 总结baiduTemplate和djangoTemplate的学习
  5. [转]Membership 到 .NET4.5 之 ASP.NET Identity
  6. 屠龙之路_战胜狮身人面怪物_SecondDay
  7. 你的C#代码是怎么跑起来的(一)
  8. 将Web应用性能提高十倍的10条建议
  9. 三种查看SqlServer中数据物理pge页的方法
  10. 启动MFC程序的时候报错:0xC0000005: 读取位置 0x00000000 时发生访问冲突
  11. 在Hyper-V虚拟机中使用Wi-Fi上网
  12. SharePoint咨询师之路:备份和恢复系列三 - 备份web和服务应用程序
  13. CSDN问答频道“华章杯”7月排行榜活动开始,丰厚奖品等你拿
  14. 关于getchar函数缓冲区的问题
  15. Java 读书笔记 (十一) Number &amp; Math 类
  16. SQL优化 MySQL版 - 避免索引失效原则(二)
  17. javascript浏览器事件
  18. python列表的切片操作允许索引超出范围
  19. 第八周--Linux中进程调度与进程切换的过程
  20. 1129 Recommendation System

热门文章

  1. jQuery.extend 函数
  2. 解决chrome无法启用印象笔记-剪藏功能
  3. (转)MySQL 加锁处理分析
  4. python3 判断大小端的一种方法
  5. artTemplate-优秀的前端模板引擎
  6. puppet的使用:puppet配置文件介绍
  7. Android 开发工具类 31_WebService 获取手机号码归属地
  8. 使用exe4j将java项目打成exe执行程序
  9. Java跨语言调用,使用JNA访问Java外部接口
  10. JS事件细分