转载:https://blog.csdn.net/xtgefzhangqing/article/details/64924063
代码:
-
<iframe name=
"son" src=
"https://www.hao123.com" width=
"100%" height=
"100%" scrolling=
"auto" security=
"restricted" sandbox=
"allow-top-navigation allow-same-origin allow-forms allow-scripts">
-
</iframe>
sandbox 属性
"" 应用以下所有的限制。allow-same-origin 允许 iframe 内容被视为与包含文档有相同的来源。
allow-top-navigation 允许 iframe 内容从包含文档导航(加载)内容。
allow-forms 允许表单提交。
allow-scripts 允许脚本执行。