小编hsh*_*anu的帖子

iframe沙盒使用'allow-same-origin'标志错误

有人可以提供有关此错误的更多信息以及"allow-same-origin"标志的工作原理吗?我在Chrome浏览器中遇到iframe Sandboxing错误:

未捕获的SecurityError:未能读取从"HTMLIFrameElement"的"contentDocument"属性:沙盒访问冲突:在"阻止帧http://192.168.0.169 "从"访问帧http://192.168.0.169 ".正在访问的框架是沙箱,并且缺少"allow-same-origin"标志.

我很困惑,为什么当192.168.0.169的帧从同一个ip地址访问另一帧时,我需要'allow-same-origin'标志.非常感谢你.

javascript iframe jquery html5 sandbox

8
推荐指数
1
解决办法
2万
查看次数

从文件中读取数据并在 python 中使用 anytree 创建一棵树

有没有办法从文件中读取数据并使用 anytree 构造树?

Parent Child
A      A1
A      A2
A2     A21
Run Code Online (Sandbox Code Playgroud)

我可以使用静态值来做到这一点,如下所示。但是,我想通过使用 anytree 从文件中读取数据来自动执行此操作。

>>> from anytree import Node, RenderTree
>>> A = Node("A")
>>> A1 = Node("A1", parent=A)
>>> A2 = Node("A2", parent=A)
>>> A21 = Node("A21", parent=A2)
Run Code Online (Sandbox Code Playgroud)

输出是

A
??? A1
??? A2
    ??? A21
Run Code Online (Sandbox Code Playgroud)

python tree file anytree

5
推荐指数
1
解决办法
5643
查看次数

标签 统计

anytree ×1

file ×1

html5 ×1

iframe ×1

javascript ×1

jquery ×1

python ×1

sandbox ×1

tree ×1