Facebook JS SDK "feed" pushes the window upwards and opens a dialog

when using the "feed" method of the FB JS SDK ... the popup created by facebook is placed at the very top of the window and automatically makes the window scroll to the top as well.

if the user is at the bottom of the web page and "submits" and opens a dialog ... they will go to the top of the page ... which ruins the experience.

any fixes here?

the problem is not an anchor tag with href = "#". I checked it out. The problem is when the window is displayed on facebook.

Please, help!


source to share

1 answer

I have no experience with the feed method, in my apps I have the corrected text to post when the user clicks on a certain button.

My javascript snippet is as follows:

    function post()
                    FB.api('/me/feed', 'post',
                        message: 'MESSAGE_TEXT',
                    }, function(response) {
                        if (!response || response.error) {
//I use javascript here to change the button image, for posting error
                        } else {
//I use javascript here to change the button image, for successfull post


It might not be the best solution, but it still works for me and I don't have a popup or something.

Hope it helps with your problem.



All Articles