wesbos
wesbos

Reputation: 26307

Facebook IFrame on page canvas?

Hey guys, I have developed a small site that i would like to embed into a tab on a facebook page.

Previously I used this code to load in an iframe, it worked great:

        <a onClick="outside_location.setInnerFBML(link_1);" style="cursor: pointer;">Link 1</a> | <a class="red" onClick="outside_location.setInnerFBML(link_2);" style="cursor: pointer;">Link 2</a>

    <div id="outside_location"></div>
    <fb:js-string var="link_1"><fb:iframe width="760" height="1280" frameborder='0' src='http://www.WebWhispers.in' /></fb:js-string>
    <fb:js-string var="link_2"><fb:iframe width="760" height="1280" frameborder='0' src='http://google.com/' /></fb:js-string>

    <script type="text/javascript" charset="utf-8">
    var outside_location = d

document.getElementById('outside_location');
</script>

However, it has stopped working. I dont think facebook allows iframe inside of pages, only applications.

How can I load this page in without learning FBML? The site uses Jquery so I cant use FBML anyway.

I know applications can use iFrames, can I make it an application and then embed the application into a page tab somehow?

Upvotes: 0

Views: 2270

Answers (2)

Karl B
Karl B

Reputation: 1597

This is either a policy change by Facebook or, more likely, a bug. I say it's unlikely to be a policy change as it throws a script error, whereas a policy change would more likely strip the code out before it's rendered.

There's a bug report you can add votes to and follow here.

Upvotes: 0

Gdeglin
Gdeglin

Reputation: 12618

No. Tab pages can not contain iFrames. They must be written using FBML and FBJS.

One reason for this is that Facebook does not want to enable Tab pages to detect who looks at them. All requests (including images) on tab pages are proxied through Facebook for this reason. If iframes were allowed then the application would be able to detect who looked at it, which would present a privacy issue for Facebook users.

Upvotes: 1

Related Questions