在iframe中获取iframe外的对象

parent.document.getElementById("dom ID");

$($(parent.document.getElementById("video-iframe")).parent().parent()).children(‘div.vid-tags‘).text(desc);

parent,top还能调用父级窗口的的js方法,比如,getIFrameDOM(iID)是父级窗口的一个方法,那么iframe里可以使用parent.getIFrameDOM("wIframeA")来调用父级窗口的getIFrameDOM(iID)方法。

时间: 2024-08-04 08:12:00

在iframe中获取iframe外的对象的相关文章

利用JQuery在iframe中获取父亲窗口的元素方法

$(window.parent.document).find("#blackbg").css("opacity","0");$(window.parent.document).find("#divdyiframe").css("display","none");利用Javascript在iframe中获取父亲窗口的元素方法window.parent或者是window.toptop永远指向

js获取iframe中的元素以及在iframe中获取父级的元素(包括iframe中不存在name和id的情况)

第一种情况:iframe中不存在name和id的方法:(通过contentWindow获取) var iframe = document.getElementsByTagName('iframe')[0];var ifr_document = iframe.contentWindow.document;//iframe中的文档内容 或者: var _iframe = document.getElementByIdx_x('iframeId').contentWindow; var _div =_

页面中获取 iframe 中的值

3.页面中获取 iframe 中的值 var obj=document.getElementsByClassName(".ke-edit-iframe").contentWindow; var obj1=obj.document.getElementsByClassName(".ke-content"); var val=eval(obj1).html();

Js/Jquery获取iframe中的元素 在Iframe中获取父窗体的元素方法

在web开发中,经常会用到iframe,难免会碰到需要在父窗口中使用iframe中的元素.或者在iframe框架中使用父窗口的元素 js 在父窗口中获取iframe中的元素  1. 格式:window.frames["iframe的name值"].document.getElementByIdx_x("iframe中控件的ID").click(); 实例:window.frames["ifm"].document.getElementByIdx_

父窗口中获取iframe中的元素

js 在父窗口中获取iframe中的元素 1. Js代码   格式:window.frames["iframe的name值"].document.getElementById("iframe中控件的ID").click(); 实例:window.frames["ifm"].document.getElementById("btnOk").click(); 2. Java代码   格式: var obj=document.get

在iframe窗体内 获取父级的元素;;在父窗口中获取iframe中的元素

原文:在iframe窗体内 获取父级的元素::在父窗口中获取iframe中的元素 在iframe中获取父窗口的元素 $('#父窗口中的元素ID', parent.document).click(); 在父窗口中获取iframe中的元素 $("#iframe的ID").contents().find("#iframe中的控件ID").click(); 原文地址:https://www.cnblogs.com/lonelyxmas/p/8353815.html

在IFrame中查找IFRAME中的元素的方式

下面是内部iframe找外部mainFrame的情况 var websiteSearchButton = window.parent.parent.document.getElementById('mainFrame')     .contentWindow.document.getElementById("webresource-search-button"); iframe中1.子页面找符页面中的元素$(window.parent.document).find(id);2.父页面-

如何在JSTL中获取数组或者list对象的索引值(index)

<c:forEach items="${productList}" var="products" varStatus="status"> 产品序号:${status.count} 产品名称:${products.name} </c:forEach> 上面代码中的varStatus是关键,${status.count}即是我们要的数组的索引值. 如何在JSTL中获取数组或者list对象的索引值(index)

Spring中获取被代理的对象

目录 Spring中获取被代理的对象 获取Spring被代理对象什么时候可能会用到? Spring中获取被代理的对象 Spring中获取被代理的对象 ### 获取Spring被代理对象的JAVA工具类 ? Spring采用CGLIB或者JDK动态代理来实现AOP,那如何获取 被代理对象?通过ApplicationContext.getBean()获取到的对象都是 利用字节码动态生成的 增强对象,那假如我们有场景获取 被代理的对象,方式如下: (封装到工具类形式里面,直接通过getTrueTarg