iframe使用

来源:互联网 发布:rundll32调用js 编辑:程序博客网 时间:2024/05/23 01:41
<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 允许脚本执行。

Jquery 在父窗口中获取iframe中的元素

$(“#iframe的ID”).contents().find(“#iframe中的控件ID”).click();//jquery 方法1

$(“#ifm”).contents().find(“#btnOk”).click();//jquery 方法1

原创粉丝点击