首页 > 其他 > 详细

iframe访问

时间:2014-09-19 13:48:25      阅读:224      评论:0      收藏:0      [点我收藏+]


访问iframe
    JavaScript代码
        document.getElementById(‘koyoz‘).contentWindow.document.getElementById(‘test‘).style.color=‘red‘
        parent.document.getElementById(‘id‘)

    jquery
    $("#koyoz").contents().find("#test").css(‘color‘,‘red‘);

    1.在父窗口中操作 选中IFRAME中的所有单选钮
        $("#objid",document.frames(‘iframename‘).document)
        $(window.frames["iframe1"].document).find("input[@type=‘radio‘]").attr("checked","true");

    2.在IFRAME中操作 选中父窗口中的所有单选钮
         $(‘#objId‘, parent.document);
        $(window.parent.document).find("input[@type=‘radio‘]").attr("checked","true");

iframe访问

原文:http://www.cnblogs.com/zodiacblog/p/3981254.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!