Jiutocrx 2014-08-05
a.html
<scriptlanguage="javascript"src="http://www.aspbc.com/js/jquery.js"type="text/javascript"></script>
<scripttype="text/javascript">
functionf()
$('#a').contents().find("#bbb").val("ddd");
}
functionfun()
{
alert('弹出子页面调用的函数');
}
</script>
<divid="maindiv">test</div>
<iframeid="a"name="a"src="b.html"width="600"height="400"></iframe>
<br/>
<inputtype="button"value="给子页面表单赋值"onclick="f()"/>
b.html
<scriptlanguage="javascript"src="http://www.aspbc.com/js/jquery.js"type="text/javascript"></script>
<scripttype="text/javascript">
functionf()
{
alert('开始调用父页面函数');
$(window.parent.fun());
$(window.parent.$("#maindiv").html("子页面赋过来的值"));
}
</script>
<formname="cform"><inputtype="text"name="b"id="bbb"/><inputname="btn"type="button"onclick="f()"value="调用父函数并给父页面元素赋值"/>
</form>
var text = "";if (!node) return "";if (!text = node.textContent;if (node.childNodes[0] && node.child