トップページ > コンテンツ > プログラミング入門 > Ajax入門 > PHP-JavaScript通信 > 通信パターン3

/*index.php*/
<form id="test">
  <input type = "text" name = "exam">
</form>
<a href="#" onclick="window.open('index2.php?a=a')">リンク</a>

/*index2.php*/
<html>
<head>
   <script>
   //textボックスの中身をHOGEに変更する。
   opener.document.getElementById("test").exam.value ="<?='HOGE'?>";
   window.close();
   </script>
</head>
</html>
最終更新:2011年04月03日 13:04