代码如下:

  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. MongoDB的数据恢复

    当MongoDB正在插入或更新数据时,若突然出现断电或者不可逆转的摧毁性事件发生时,MongoDB没有像oracle或sql server这种关系型数据库提供事物机制,所以会产生垃圾数据.但Mongo ...

  2. mybatis parameterType和resultType的顺序问题

    有一次在写java web后端的代码中发现了一个问题,那就是我将parameterType放在resultType之前的时候,发现程序启动的时候突然报错,说找不到某某map,我也不知道,所以感觉非常怪 ...

  3. ssm框架整合shiro

    1.导入shiro相应jar包,也可下载shiro-all.jar; 2.web.xml添加shiroFilter配置,类似于mvc <!-- shiro 安全过滤器--> <fil ...

  4. 问题:bower git is not installed or not in the path

    用bower install jquery安装jquery,bower提示错误bower git is not installed or not in the path. 根据错误信息的知道出现错误两 ...

  5. 【Python-虫师】自动化测试模型--参数化

    一.自动化测试代码最开始是线性的,后续发展为模块化代码,所以涉及到了函数和方法的引用. 1. 函数和方法的最主要区别: Python的方法中定义函数的时候,函数中必须写self.而单独定义函数的时候则 ...

  6. 008-spring cloud gateway-路由谓词RoutePredicate、RoutePredicateFactory

    一.概述 Spring Cloud Gateway将路由作为Spring WebFlux HandlerMapping基础结构的一部分进行匹配. Spring Cloud Gateway包含许多内置的 ...

  7. Andrew Ng-ML-第十八章-大规模机器学习

    1.学习大数据集 图1.学习大数据集 当数据集量为m=1亿时,进行梯度下降将会花费较大时间. 可以使用小量数据集进行训练,然后得出学习曲线. 左图是高方差,右图是高偏差. 总之是要通过高效的学习算法来 ...

  8. mysql 常用命令 常用SQL语句

    维护命令 数据库 ##创建数据库 mysql> create database test; Query OK, 1 row affected ##删除数据库 mysql> drop dat ...

  9. [lr] 常用快捷键

    界面基本操作 F5               : 隐藏/显示上部面板 F6               : 隐藏/显示下部面板 F7               : 隐藏/显示左部面板 F8     ...

  10. django登录功能(简单在POST请求)

    第一  先在templates中创立index.html !DOCTYPE html> <head> <meta charset="UTF-8"> & ...