开发者

Facebook Connect JS API / Internet Explorer trouble

开发者 https://www.devze.com 2023-01-05 15:14 出处:网络
I\'m building a Flash-based (AS开发者_运维技巧3) website that incorporates Facebook Connect through a combination of the AS3 API and the Javascript API.Everything is working fine in Firefox; users are

I'm building a Flash-based (AS开发者_运维技巧3) website that incorporates Facebook Connect through a combination of the AS3 API and the Javascript API. Everything is working fine in Firefox; users are able to authenticate / login via the site, and I can make calls and receive userdata from Facebook without a problem.

However, in IE (7 & 8, at least), my call to FB.Connect.requireSession(onLoginHandler), which should prompt users to connect/login, fails silently--nothing happens. I fired up the IE javascript console to investigate the situation; here's a brief transcript (>> is the console prompt):

>>FB
{...}
>>FB.Connect
{...}
>>FB.Connect.requireSession(onLoginHandler)
undefined
>>someNonExistentVariable
"'someNonExistentVariable' is undefined"

As you can see, FB and FB.Connect are both defined, and it appears that FB.Connect.requireSession is as well; compare the "undefined" it returns with the error message thrown when I try to reference a non-existent variable. However, I've got no idea whyFB.Connect.requireSession is returning undefined and I've got to get this application working in all browsers.

Any thoughts as to what might be causing this?

Thanks in advance for your consideration!


I figured out what was going on; this URL proved helpful: http://wiki.developers.facebook.com/index.php/Connect/Authorization_Websites

In my call to requireSession, I was omitting the second parameter ("isUserActionHint"), which needs to be set to 'true' when the call is made in the context of a Flash site. Apparently Firefox didn't mind that it was missing, but IE's a stickler for it. Hopefully this helps someone else down the line...

0

精彩评论

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