代码如下:

  1. <html>
  2. <head>
  3. <script>
  4. /*window.frames[]可以通过下标或名称访问单独的frame*/
  5. window.onload=function(){
  6. var h1=window.frames["header"];//.document.getElementsByTagName('h1');
  7. alert(h1);
  8. }
  9. </script>
  10. </head>
  11. <frameset rows="80,*">
  12. <frame src="top.html" name="header"></frame>
  13. <frameset cols="180,*">
  14. <frame src="menu.html" name="menu"></frame>
  15. <frame src="main.html" name="main"></frame>
  16. </frameset>
  17. </frameset>
  18. </html>

原因:跨页面操作涉及域的概念(origin),错误的意思是:未捕获的安全错误:阻止了一个域为null的frame页面访问另一个域为null的页面。代码运行时在本地直接用浏览器打开的,地址栏是file:///的页面,只需改为localhost访问就行。

【运行错误】Uncaught DOMException: Blocked a frame with origin "null" from accessing a cross-origin frame.的更多相关文章

  1. Uncaught DOMException: Blocked a frame with origin "http://localhost

    ajaxFileUpload上传时报错 :Uncaught DOMException: Blocked a frame with origin "http://localhost..... ...

  2. 跨域打开页面:Uncaught DOMException: Blocked a frame with origin

    Uncaught DOMException: Blocked a frame with origin 使用postMessage()方法可以解决跨域传值的问题 Api: https://develop ...

  3. iframe跨域问题:Uncaught DOMException: Blocked a frame with origin解决方法

    在前后端分离的情况下,前台页面将后台页面加载在预留的iframe中:但是遇到了iframe和主窗口双滚动条的情况,由此引申出来了问题: 只保留单个滚动条,那么就要让iframe的高度自适应,而从主页面 ...

  4. 跨域问题 Uncaught DOMException: Blocked a frame with origin。。。

    第三方系统内嵌 到iframe中的 跨域问题. 解决方案: http://www.ruanyifeng.com/blog/2016/04/same-origin-policy.html

  5. iframe框架自适应高度 uncanght SecurityError: Blocked a frame with origin "null" from accessing a frame ....

    来源于crm项目的contact/edit.html 一.背景是这样的 最近在做crm系统的前端页面,有一个页面呢,点击“查看全部信息”时会弹出,这个弹窗里面又有分页导航,分页不是使用ajax 异步刷 ...

  6. Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported

    Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may no ...

  7. 【chrome错误】Cross origin requests are only supported for protocol schemes: http, data,chrome-extension, https, chrome-extension-reso

    使用ajax请求本地文件,chrome会报跨域错误. XMLHttpRequest cannot loadfile:///C:/Users/Li/Desktop/images/alist.json.C ...

  8. 解决 canvas 将图片转为base64报错: Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasEleme...

    问题描述 当用户点击分享按钮时,生成一张海报,可以保存图片分享到朋友圈,用户的图片是存储在阿里云的OSS,当海报完成后,执行.canvas.toDataURL("image/png" ...

  9. 使用wpaint绘图软件时:Uncaught DOMException: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0.

    使用wpaint绘图软件时:Uncaught DOMException: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': Th ...

随机推荐

  1. 它是对 ACME(automated certificate management environment) 协议的实现,只要实现了 ACME 协议的客户端都可以跟它交互。

    它是对 ACME(automated certificate management environment) 协议的实现,只要实现了 ACME 协议的客户端都可以跟它交互. https://mp.we ...

  2. redux+react-redux+示例的快速上手体验

    刚学习redux的同学提供一些可供参考的例子. 之前用vue用了很久 vue的语法糖用起来是真的舒服  react 其实毕竟他们都是类似的框架, 虽然语法大不同, 但是有些地方的思想还是很像的, 废话 ...

  3. getopts shell command -options parameters

    说明:原文网址http://blog.chinaunix.net/uid-26807463-id-3151601.html 获取UNIX类型的选项: unix有一个优点就是标准UNIX命令在执行时都具 ...

  4. html中一些文字标签

    <!DOCTYPE html><html><head> <meta charset="utf-8"> <title>菜鸟 ...

  5. 2018/03/15 每日一个Linux命令 之 mv

    Linux mv命令用来为文件或目录改名.或将文件或目录移入其它位置. mv [参数] [要移动/更名的文件] [移动路径/要更改名字] 平常用的很多了,这里就不多讲解了,只介绍两个重要参数就好了 - ...

  6. pycharm中python模板代码自动生成

    # -*- coding: utf-8 -*- """ ------------------------------------------------- File Na ...

  7. 菜鸟教程之工具使用——Git的基本使用

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/liushuijinger/article/details/37569907 Git是进来比較火的版本 ...

  8. Flask中'endpoint'(端点)的理解

    翻译整理自Stack Overflow:http://stackoverflow.com/questions/19261833/what-is-an-endpoint-in-flask 原文中用到了m ...

  9. Oracle数据库返回字符类型-1~1的结果处理

    如果实体类中定义的字段是String类型,Oracle数据库中返回的是数字类型,那么Oracle返回0.xxx的时候会丢失前面的0. 要想不丢失0,那么数据库返回的就要是字符串类型的,所以要将返回值转 ...

  10. 二进制协议 vs 文本协议

    二进制协议 vs 文本协议 在服务器程序开发过程中,各个服务直接需要进行交互.这样就需要定义消息的协议,一般来说协议主要包括二进制协议和文本协议,下面就我在工作中用到的两种协议说说自己的看法. 1 二 ...