Reputation: 2297
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.
Upvotes: 1
Views: 367
Reputation: 2297
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);
}
});
});
});
}
Upvotes: 1