开发者

Facebook standard status update popup?

开发者 https://www.devze.com 2023-02-04 07:27 出处:网络
Is there an API for opening a popup containing the same status update functionality as in the Facebook Wall?

Is there an API for opening a popup containing the same status update functionality as in the Facebook Wall?

I basically want to o开发者_运维百科pen the following UI in a popup...

Facebook standard status update popup?

How can I do that?


You have to mention the onclick function else what suits your need. oauth2 in facebook involves two steps, call authorize to get code, then call access_token to get token. One way to deal with the pop login:

open login url in new window just like you did,when the facebook redirects back to your url in the popup, you set the cookie either through server side code or using javascript to capture url query parameter, when page is loaded in the popup, close the window immediately window.close.

On your main page, after your window.open code, add JavaScript code to detect if popup is closed and capture the cookie:

var signinWin;

`$('#FacebookBtn').click(function () {
        var pos = screenCenterPos(800, 500);
        signinWin = window.open("[URL]", "SignIn", "width=780,height=410,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left=" + pos.x + ",top=" + pos.y);
        setTimeout(CheckLoginStatus, 2000);
        signinWin.focus();
        return false;
    });

function CheckLoginStatus() {
    if (signinWin.closed) {
        $('#UserInfo').text($.cookie("some_cookie");
    }
    else setTimeout(CheckLoginStatus, 1000);
}`

hope it help you.


The facebook UI responsible to post a feed is described here.

If you want to have the same design in your application you have to design it yourself, which would be easy with jQuery + ajax

0

精彩评论

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

关注公众号