iframe提取与改变父页面元素

来源:互联网 发布:俊知集团官网 编辑:程序博客网 时间:2024/06/09 22:54

一:利用jquery方法获得


1:取值

$(window.parent.document).find("#second_navigator").html();


2:改变父页面元素

$(window.parent.document).find("#second_navigator").html(“我是从iframe里传来的值”);


二:javaScript方法


1:取值

window.parent.document.getElementById("second_navigator").innerHTML;


2:改变父页面元素

window.parent.document.getElementById("second_navigator").innerHTML="我是从iframe里传来的值";

0 0