在Iframe中搜索特定的标记,然后创建另一个Iframe
Search inside Iframe for a specific tag and create another iframe
我有以下代码:
<FORM target="frame" onsubmit="document.getElementById('frame').style.display = 'block';" method="post" action="http://www.example.com/index.html">
<input type="text" autocomplete="off" value="" name="search-field" id="header-search-field">
<button type="submit">Search</button></FORM>
<iframe width="700" height="700" id="frame" name="frame" style="display: none;"></iframe>
Iframe在提交表单时显示正确。现在我必须创建第二个Iframe,它在之前加载的内容中搜索特定的标签,并且只有在找到时才显示。我必须搜索一个特定的标签:
<table id="item_specification" cellspacing="0" cellpadding="0"> with all the content inside </table>
并且只显示表ID内的内容(也有表)
如果您没有违反跨来源策略,您可以通过以下方式访问iframe文档:
document.getElementById('header-search-field').contentDocument
相关文章:
- 防止Iframe窗体在新窗口中打开
- Pinterest 扩展如何存储(临时)网页中的图像,然后在 iframe 中访问它们
- 如何将javascript文件插入到iframe中,然后调用插入的javascript中的函数
- 从iframe调用Parent函数,然后更新iframe表单值
- 从 iframe 内部关闭引导模式,然后转到父页面的特定部分
- 获取 IFrame 源,然后更新输入文本框
- 打开一个带有URL的iframe,然后运行一些JS
- 使用下拉菜单加载 iframe 的 src,然后进行更改
- 如果我在我的页面上使用 CSS 缩放,然后将另一个包含动画的网站加载到 iframe 中,我的页面会变得模糊并且动画行为
- on单击“显示iframe 5000”,然后隐藏
- 从javascript表单中获取url,然后在iframe中显示
- 在Iframe中搜索特定的标记,然后创建另一个Iframe
- Javascript检查页面网址,然后加载相应的iframe
- 创建一个iframe,然后用jQuery向其添加数据
- 使用Javascript将URL变量输出到字符串,然后在iframe中使用该字符串
- 通过编程方式在iframe中选择一个输入类型的文件,然后上传会给出Access is denied错误
- 为iframe设置样式,然后使其可见
- 隐藏iframe直到链接被点击,然后在链接被点击后隐藏链接
- Iframe传递变量并捕获然后进入登录页
- 如何添加脚本到iframe,然后添加一个元素来触发它