2012-10-06 56 views
1

我可以選擇在我的網站上邀請Facebook朋友,我使用下面給出的代碼。但問題是它在彈出窗口中打開,Chrome和Firefox會阻止彈出窗口。我如何讓它出現在新標籤頁或窗口中?或者有什麼辦法讓我的彈出不會被阻止?我可以避免在您的網站上阻止「邀請您的Facebook好友」彈出窗口被阻止嗎?

<html> 
    <head> 
    <title>my website</title> 
    </head> 
    <body> 
    <div id="fb-root"></div> 
    <script src="http://connect.facebook.net/en_US/all.js"> 
    </script> 
    <script> 
    FB.init({ 
     appId:'xxxxxxxxxxxxxxx', cookie:true, 
     status:true, xfbml:true 
    }); 

    FB.ui({ method: 'apprequests', 
     message: 'Take a look at this new website.'}); 
    </script> 
    </body> 
</html> 

回答

1

你基本上有2個選項;

  1. 公開賽鼠標點擊事件彈出(因爲這些不被瀏覽器),或者

  2. 不要使用真正的彈出窗口,而是使用一些很酷的DHTML小部件一樣http://thickbox.net/

相關問題