代码如下:

  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. LCA——最近公共祖先

    今天终于把倍增的LCA搞懂了!尽管周测都没写,尽管lca其实很简单,但这也是进度君的往前一点点的快乐.学渣的呻吟. 倍增的lca其实关键就在于二进制的二进制的拆分(显然是两次的拆分,很奇妙,懂二进制的 ...

  2. python全栈开发目录

    python全栈开发目录 Linux系列 python基础 前端~HTML~CSS~JavaScript~JQuery~Vue web框架们~Django~Flask~Tornado 数据库们~MyS ...

  3. QtCreator 可以通过 Clang-Tidy 和 CLazy 对你的代码进行静态检查

    QtCreator 可以通过 Clang-Tidy 和 CLazy 对你的代码进行静态检查 打开你的工程,点击Analyze -> Clang-Tidy and CLazy 选择你想分析的 cp ...

  4. The Unique MST----poj1679次小生成树

    题目链接:http://poj.org/problem?id=1679 判断最小生成数是否唯一:如果唯一这权值和次小生成树不同,否则相同: #include<stdio.h> #inclu ...

  5. Python一键安装全部依赖包

    requirements.txt用来记录项目所有的依赖包和版本号,只需要一个简单的pip命令就能完成. pip freeze >requirements.txt 然后就可以用 pip insta ...

  6. 循环结构 while,do while

    while:先判断条件表达式是否成立,成立则执行循环体,不成立则不执行. 格式:while(条件表达式){ 执行语句(控制循环次数): } 例如: int x=1; while(x<3/*条件表 ...

  7. 训练/验证/测试集设置;偏差/方差;high bias/variance;正则化;为什么正则化可以减小过拟合

    1. 训练.验证.测试集 对于一个需要解决的问题的样本数据,在建立模型的过程中,我们会将问题的data划分为以下几个部分: 训练集(train set):用训练集对算法或模型进行训练过程: 验证集(d ...

  8. pandas中的axis=0,axis=1,傻傻分不清楚

    简单的来记就是axis=0代表往跨行(down),而axis=1代表跨列(across) 轴用来为超过一维的数组定义的属性,二维数据拥有两个轴: 第0轴沿着行的垂直往下,第1轴沿着列的方向水平延伸. ...

  9. Quick Look at the Air Jordan 32

    A color with 25 years of history in the Air Jordan line will once again leave its mark on the Air Jo ...

  10. 面试官说:说一说CommonJs的实现原理

    其实刚看到这个题目的时候,我的内心是拒绝的,但是本着对科学的敬畏精神,我开始了 CommonJs 的探索之路. 来来来奉上我这几天的心血,拿走不客气.如有错误欢迎指正,共同进步. 提到CommonJs ...