6

I'm making an app on facebook and have chosen iframe instead of FBML. The problem i'm facing is linking to various other pages of the app. Suppose that I've hosted my app here http://fbapp.mysite.com and I want to link http://fbapp.mysite.com/page1, how should I do that inside the iframe? Linking directly to fbapp.mysite.com/page1 just redirects the whole browser window from facebook.com to fbapp.mysite.com. I still want the app to very much "live" inside the canvas page, but want to navigate to a page1. Any help will be appreciated.

2 Answers 2

10

Instead of

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

Use

<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 automatically passes through any arguments (paths AND query strings) to your callback URL.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.