Problem:
AA.html中有一ID为: content 的文本域(textarea),
BB.html中的一段js来给AA.html中ID为: content 的文本域赋值
solution:
1, main.html
<body>
<iframe ID="AAA" name="AAA" src="AA.html" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:265px;width:814px;"></iframe>
<iframe ID="BBB" name="BBB" src="BB.html" frameBorder="0" marginHeight="0" marginWidth="0" scrolling="No" style="height:265px;width:814px;"></iframe>
</body>
2,AA.html
<body>
<form method="post" name="form1">
<p><textarea rows="5" name="content" id="content" cols="73"></textarea></p>
</form>
</body>
3,BB.html
<body οnlοad='window.parent.AAA.form1.content.value="data from BB";'>
<br>
</body>
相关资源:js 实现iframe 之间传值