开发者

Communicating with parent (Facebook FBML Page) from iFrame (Local page)

I'am currently developing a Facebook application which has a iFrame in it. The iFrame loads a Java applet (So the FBML Page is just a wrapper for header footer and the FBML functions).

The current situation is, for example, the Java applet has a event (User finished playing a game) and it does a javascript call on the iFrame page. What it then needs to do is call a javascript in the parentwindow (Facebook.streamPublish()) so that the user gets the ability to publish his score / event / win / loss whatever.

iFrame code on FBML Page :

<fb:iframe id='appletIframe' frameborder='0' resizable='true' scrolling = 'no' name='appletIframe' src='appletPage.php'></fb:iframe>

Every time i try to communicate with the parent, i get a access denied because it is a cross domain call. I wonder if its possible with Facebook.connect or some other technique to make calls to the parent 开发者_StackOverflowor if there is any other way. If a user finishes a game, there should be a minimal delay between the iFrame call and Parent call.

The reason i do the applet in the iFrame is, because the applet is deployed by deployJava (Class distributed by Sun) and if i run that on a facebook FBML Page, the Javascript navigator class will get appended (a_navigator) and it wont run.

I hope i was clear enough in the description, anyone have any idea's?

Thanks in advance for the help,

Michael


Hello i just have experienced this problem and wanted to do something like you and i felt hacked .But what i did was use it yourApplet.getAppletContext().showDocument(url,"_parent");.This helps me to redirect to other window where i have the script to publish.In this new window,i have a button to publish via javascript a story.This button could not be necesary

It is important to use the "_parent", so you can redirect the parent window.

I wish this helps


old issue ... but here's a very good resource http://softwareas.com/cross-domain-communication-with-iframes

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜