Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook App, Iframe Worries (URL problem)

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.

like image 237
Swamy g Avatar asked Feb 27 '09 14:02

Swamy g


1 Answers

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.

like image 194
Portman Avatar answered Sep 29 '22 22:09

Portman