1

I am a learner in jquery. Can anyone help me for this code.

 function login() {
            FB.api('/me?fields=name,email', function (response) {

                    $.ajax({
                        type: "POST",
                        url: "Login.aspx/SaveFacebookAutoSignUp",
                        data: "{ 'Name':'" + rows[0].name + "', 'EmailId': '" + rows[0].email +"'}",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function (msg) {
                            alert("You have successfully sign in.");

                        }
                    });

                });
            });
        }

Above call is made for "SaveFacebookAutoSignUp()" function in my code behind file.

this function returns user id in string format.

Can any one help me how to handle (get) return value from the function in jquery to handle more action in my page.

1 Answer 1

1

a simple way to da

function login() {
        FB.api('/me?fields=name,email', function (response) {

                $.ajax({
                    type: "POST",
                    url: "Login.aspx/SaveFacebookAutoSignUp",
                    data: "{ 'Name':'" + rows[0].name + "', 'EmailId': '" + rows[0].email +"'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (data) {
                        alert(data.d);

                    }
                });

            });
        });
    }
Sign up to request clarification or add additional context in comments.

1 Comment

replace rows[0].name --> response.name and so on

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.