Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on start:
- window.fbAsyncInit = function () {
- FB.init({
- appId: FB_APP_ID,
- status: true,
- cookie: true,
- oauth: true,
- xfbml: true
- });
- FB.Event.subscribe("auth.login", function (a) {
- uid = a.authResponse.userID;
- accessToken = a.authResponse.accessToken;
- });
- FB.getLoginStatus(function (a) {
- if (a.status === "connected") {
- uid = a.authResponse.userID;
- accessToken = a.authResponse.accessToken;
- fb_loginok()
- }
- });
- };
- (function (a) {
- var b, c = "facebook-jssdk";
- if (a.getElementById(c)) {
- return
- }
- b = a.createElement("script");
- b.id = c;
- b.async = true;
- b.src = "//connect.facebook.net/en_US/all.js";
- a.getElementsByTagName("head")[0].appendChild(b)
- })(document);
- to make the post i use:
- FB.api("/" + FB_PAGE_ID + "/feed", "post", {
- message: "test"
- }, function (a, b, c) {
- if (!a || a.error) {} else {
- dosomething();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement