Can I avoid 'invite your facebook friends' pop up being blocked on my website?

StackOverflow https://stackoverflow.com/questions/12756313

  •  05-07-2021
  •  | 
  •  

質問

I have an option to invite facebook friends on my website and I use the code given below. But problem is that it opens in a pop up and chrome and firefox do block the pop up. How can I make it appear in a new tab or window ? Or is there any way so that my pop up won't get blocked ?

<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>
役に立ちましたか?

解決

You basically have 2 options;

  1. Open the popup on a mouseclick event (since these are not blocked by the browser), or

  2. Don't use a real popup, but instead use some cool DHTML widget like http://thickbox.net/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top