on_clickフォームを送信し、送信ボタンの2 つの関数を呼び出す親ページがあります。同じページからの 1 つの関数と、子ページからの別の関数。
子ページから親ページで Javascript 関数を呼び出して Facebook ウォールに投稿する方法を知りたいです。これは私のアプリケーションです。
私のparent.php:
<form action="child.php" method="post">
   <input type="text" value="$result" name="codebox">
   <input type="submit" onclick="funcion codeload();function postToFeed();"/>
</form>
私のchild.php:
 <body> 
  <?PHP
          $son=$_REQUEST['codebox'];
          session_start();
          $_SESSION['sony'] =$son;
          $ashutosh=$_SESSION['sony'] ;
          $tinyurl = file_get_contents("http://tinyurl.com/api-create.php?                 
                url=http://www.ebhasin.com/approval/files/main.php?a=$ashutosh");
          $desc='Place here description what you want';
  ?>
<div id='fb-root'></div> 
<script src='http://connect.facebook.net/en_US/all.js'></script>
<p id='msg'></p>    
<script>
  FB.init({appId: "313877282043416", status: true, cookie: true});
  function postToFeed() {
    // calling the API ...
    var obj = {
      method: 'feed',
       link: '<?PHP echo $tinyurl?>',
            picture: 'http://www.dogoscanarios.com/en/themes/dogotheme/images/icon_dot_cat.gif',
      name: 'Drum Precussion',
    caption: ' I just created a new Drum Loop using Drum Beats Pro! Come listen to it!',
      description: '.'
    };
    function callback(response) {
      document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
    }
    FB.ui(obj, callback);
  }
</script>