重複の可能性:
コンテンツに基づいてiframeのサイズを変更する
私がやろうとしていることは:
divを使用して、ajaxを使用する代わりにフォームを投稿します。これは、ajaxで機能しないことが必要な場合があるためです。私が使用している2ページのコードは以下のとおりです。
フォームのあるページ:
<form action="iframe.php" method="post" onsubmit="document.getElementById(\"\")" target="my_iframe">
<input type="hidden" name="post" value="postdata" />
<input type="submit" value="Do Stuff!" />
</form>
<!-- when the form is submitted, the server response will appear in this iframe -->
<iframe frameborder="0" name="my_iframe" id="frame" src="iframe.php"></iframe>
iframeソース:
<?php
if(isset($_POST['post'])){
var_dump($_POST);
}
?>
これについて私は何ができますか?前もって感謝します!