zoukankan      html  css  js  c++  java
  • 页面调用Iframe中数据

    <iframe src="html的路径(至于MVC中cshtml直接路径好像是不行的,得使用action进行请求出来的路径)" id="iframechild" style="position: absolute; left: 0px; top: 0px;  100%; height: 100%;"></iframe> 
    
    $("#iframechild").contents().find("#store_image").attr("src", $("#show_image_1").attr("src"));
    

    $("#iframe名称").contents()即为iframe的对象

    js的写法:

     var _iframe = document.getElementById('iframeId').contentWindow;
            var _div =_iframe.document.getElementById('objId');
    

    至于在iframe中获取父级页面的数据,则是直接使用parent,这个值就是父级窗口对象了

    $(parent)即成为jquery对象

    js的写法:

    var _iframe = window.parent;
            var _div =_iframe.document.getElementById('parDiv');
    
  • 相关阅读:
    不透明度
    浮动塌陷
    滑动门技术
    文本替换
    清除浮动
    浮动
    定位概述
    IE6中使用通用选择器模拟子选择器效果
    js对象
    bzoj:2049: [Sdoi2008]Cave 洞穴勘测
  • 原文地址:https://www.cnblogs.com/danlis/p/7568571.html
Copyright © 2011-2022 走看看