大丈夫。私は基本的に、他のウェブサイトにつながる自分のウェブサイトに iframe を作成したいと考えています。
私の iFramed Web サイトには、テキスト フィールドと [送信] ボタンのあるフォームがあります。テキスト フィールドにテキストを挿入し、サイト A (iframe を含むボタン) のボタンをクリックしたときに送信ボタンをクリックしたいと思います。
何らかの方法で可能ですか?
次のことを試しましたが、うまくいかないようです:
<script type="text/javascript">
function insertTxt() {
var textstring = "test successful";
window.frames["iframeAB"].document.documentElement.getElementsByTagName("textarea")[0].value = textstring;
}
</script>
<iframe name="iframeAB" src ="index.html" id="qab" width="100%" height="210" style="border:1px solid #009ee0">
Your browser doesn't handle iframes
</iframe>
<input type="button" value="Go" onclick="top.frames['iframeAB'].window.document.body.getElementById('text_field').value='test successful';"/>
<a href="#" onclick="insertTxt();">test</a>