Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load Facebook Sharer in iFrame

Tags:

facebook

I'm just trying to load the facebook sharer page into an iframe which is in a positioned div with no success.

Here is the code I'm using for the iframe,

<iframe src="http://www.facebook.com/sharer.php?u=http://www.website.com&t=Title Hoes Here"></iframe>

When I view the page its blank and the iframe source is

<iframe src="http://www.facebook.com/sharer.php?u=http://www.website.com&t=Title Hoes Here">
<html>
<body></body>
</html>
</iframe>

If I view the url directly, everything appears properly.

Does facebook block loading the sharer in an iFrame? and what are my alternatives to have the facebook sharer appear in a modal window?

Thanks

like image 558
hooligan Avatar asked Feb 15 '12 21:02

hooligan


People also ask

How to add Facebook feed widget to iframe website?

Simply set Facebook Feed and embed it on your iFrame website 1 Create a unique iFrame Facebook page widget in our demo and get installation code to put in on your site. 2 Embed the code into the page of your site or template, where you plan the widget. 3 Done! Facebook Feed widget is installed on your iframe website. More ...

How to boost your social media marketing With iFrame?

Uplift your social media marketing to another stage supported by iFrame Facebook page widget. A brand that has current profiles in social media networks gets 74 more trust among users. Use your Facebook profile on website, to reassure clients your business is true and trusted.

How to create a share button on Facebook or Twitter?

Pick the URL of a website or Facebook Page you want to share. 2. Code Configurator. Paste the URL to the Code Configurator and adjust the layout of your share button. Click the Get Code button to generate your share button code. 3. Copy & Paste HTML snippet. Copy and past the snippet into the HTML of the destination website.

How to create a share button from a URL?

1. Choose URL or Page. Pick the URL of a website or Facebook Page you want to share. 2. Code Configurator. Paste the URL to the Code Configurator and adjust the layout of your share button. Click the Get Code button to generate your share button code. 3. Copy & Paste HTML snippet. Copy and past the snippet into the HTML of the destination website.


1 Answers

Yes, Facebook pretty much blocks all loading of screens inside of iFrames.

If you are using Facebook connect there is some simple javascript methods you can execute to get a dialog on your page, and to boot Facebook will take care a lot of the work it takes to make the screen look nice.

See this link ( http://developers.facebook.com/docs/reference/javascript/FB.ui/ ) or use the code below:

FB.ui(
  {
    method: 'feed',
    name: 'Facebook Dialogs',
    link: 'http://developers.facebook.com/docs/reference/dialogs/',
    picture: 'http://fbrell.com/f8.jpg',
    caption: 'Reference Documentation',
    description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'
  },
  function(response) {
    if (response && response.post_id) {
      alert('Post was published.');
    } else {
      alert('Post was not published.');
    }
  }
);

If you are not using Facebook connect then really your only option to get that exact screen is to throw a pop-up.

Another option would be to use the like/send button plugin, this isn't quite the same functionality but is easier to integrate. http://developers.facebook.com/docs/plugins/

Cheers!

like image 176
jtymann Avatar answered Nov 15 '22 16:11

jtymann