Question

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>
Was it helpful?

Solution

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/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top