Muhammad_42 0 Newbie Poster

I'm working on Asp MVC 4 framework. in my "abc" page's layout file i added fb login dialog box and fb like button.

`<script>(function (d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if d.getElementById(id))return;js = d.createElement(s);js.id = id;js.src = //connect.facebook.net/en_US/all.js#xfbml=1&appId=appid";fjs.parentNode.insertBefore(js, js); } (document, 'script', 'facebook-jssdk'));</script>`

and now i added a partial view in "abc" page which is using the fb app request dialog.

`<script src="//connect.facebook.net/en_US/all.js"></script>    
<script type="text/javascript">
    FB.init({
                appId: 'xxxxx', cookie: true,
                status: true, xfbml: true,
                frictionlessRequests: true
    });


    function all() {
        FB.getLoginStatus(function (response) {
            if (response.status === 'connected') {
                var friend = new Array();
                FB.api('/me/friends', function (response) {
                    if (response.error) {
                        console.log('Error - ' + response.error.message);
                        return;
                    }
                    for (var i = 0; i < response.data.length; i++) {
                        friend[i] = response.data[i].id;
                        // alert(friends[i]);
                    }
                    mshuffle(friend);
                    loop(friend);



                });

            } else {
                //user is not connected.
                FB.login(function (response) {
                    if (response.authResponse) {
                        var friend = new Array();
                        FB.api('/me/friends', function (response) {
                            if (response.error) {
                                console.log('Error - ' + response.error.message);
                                return;
                            }
                            for (var i = 0; i < response.data.length; i++) {
                                friend[i] = response.data[i].id;
                                // alert(friends[i]);
                            }
                            mshuffle(friend);
                            loop(friend);


                        });

                    } else {
                        alert('User cancelled login or did not fully authorize.');
                    }
                });
            }
        });

    } function sendRequestToFriends() {
        all();

    } </script>`

but when the partial view is loaded and i click on invite friends button the fb.ui will displayed and the popup will keeps loading and the friends list will not be displayed. this fb app request code was working fine on simple page which have is inherit from other layout file which is not using any fb gadgets. thanks