facebook
  • facebook-javascript-sdk
  • share
  • facebook-social-plugins
  • 2012-03-24 42 views 0 likes 
    0

    我已經使用這個代碼加入人人網分享按鈕我的網頁:Facebook分享按鈕分享的,而不是當前頁面的URL,標題,等我的登錄頁面

    <a name='fb_share' border="0">Share</a> <script type='text/javascript' src='jquery.js'> </script> <script src='http://static.ak.fbcdn.net/connect.php/js/FB.Share' type='text/javascript'> </script>

    上面的代碼共享電流網頁正確,但是當我在網頁開始處包含會話檢查時,如果有效會話不存在,我將用戶重定向到登錄頁面,上面的代碼始終共享登錄頁面而不是當前頁面。我正在使用PHP頭函數進行重定向。請指教。

    回答

    1

    從沒有公開訪問的頁面使用共享內容Feed Dialog

    0

    我使用{}您可以根據需要取消註釋功能。請記住所有的分享按鈕功能,不推薦使用類似/推薦按鈕。


    <div id="msg"></div> 
        <script> 
          function feedthis() { 
         var obj = { 
          method: 'feed', 
        //to: ''+tobe+'' 
         //link: 'https://developers.facebook.com/docs/reference/dialogs/', 
         //picture: ''+pic+'', 
         // name: 'Facebook Dialogs', 
         //caption: 'Reference Documentation', 
         //description: ''+msg+'' 
         }; 
    
         function callback(response) { 
          document.getElementById('msg').innerHTML = "Post ID: " + response['post_id']; 
         } 
    
         FB.ui(obj, callback); 
         } 
    </script> 
    
    相關問題