Facebook app, Iframe Worries (URL issue)

I am making an application on facebook and have selected iframe instead of FBML. The problem I am facing is related to various other pages of the application. Suppose I hosted my application here http://fbapp.mysite.com and I want to link http://fbapp.mysite.com/page1 , how do I do this inside an iframe? A direct link to fbapp.mysite.com/page1 simply redirects the entire browser window from facebook.com to fbapp.mysite.com. I still want the application to be very lively on the canvas page, but you want to go to page1. Any help would be appreciated.

+6
web-applications facebook iframe
source share
2 answers

Instead

<a href="http://fbapp.mysite.com/page1">link</a> 

Using

 <a href="http://apps.facebook.com/{canvasurl}/page1" target="_top">link</a> 

This will load the URL in the topmost frame (Facebook itself), and Facebook will automatically pass any arguments (paths and query strings) to your callback URL.

+10
source share
  FB_RequireFeatures(["CanvasUtil"], function() { FB.Facebook.init(<api_key>, <path to xd_receiver>); FB.CanvasClient.startTimerToSizeToContent(); FB.CanvasClient.syncUrl(); }); 
0
source share

All Articles