views:

16

answers:

1

Can we use the old and new Facebook Javascript SDK on the same webpage? (the old Javascript SDK is used by the "Login with Facebook" and "Share" button. The new Javascript SDK is to be used by the "Like" button)

The old Javascript SDK is included by Facebook's

FeatureLoader.js.php
xd_receiver.html
docs: http://developers.facebook.com/docs/reference/oldjavascript/

The new Javascript SDK is included by Facebook's

connect.facebook.net/en_US/all.js
docs: http://developers.facebook.com/docs/reference/javascript/

they both define FB, and they conflict with each other.

+1  A: 

No it's not possible, it either one or another.

serg
is it hard to convert the old JS SDK to the new one when the old one is being used for "Log in with Facebook" and "Share" button? (using Facebooker gem, but basically I think it just output the JS and HTML). Do you know how to convert them if just in JS?
動靜能量
@動靜能量 No its not hard. If you go to fb docs they have examples for those methods. The biggest difference would be if you need session key on your server side, as it was replaced with access token.
serg
@serg examples for those methods... are they the pages in the 2 links in the original post?
動靜能量
I think some people say REST API can be used with Graph API on the same page but probably means the app's web server making the calls, so old API, new API, it doesn't matter really, can be either or both, but then JS SDK, a different story.
動靜能量
@動靜能量 yes that's probably what they mean. You can have old api on server side and new one on front end but can't have both on front end. And yes those links you posted contain examples.
serg