我正在为我的项目使用 facebook API,并在 var 中以下列方式获取一些数据mydata
if (response.status === "connected")
{
LodingAnimate(); //Animate login
FB.api('/me?fields=movies,email', function(mydata) { //--
console.log(mydata);
if(data.email == null)
{
alert("You must allow us to access your email id!");
ResetAnimate();
}
}
我对此代码没有任何问题。但我想使用 ajax 调用发送这些数据来处理并插入数据库。
我的ajax调用:
function AjaxResponse()
{
var send=document.ge(mydata) **//Here I want to fetch mydata from previous code**
var datas = document.elements['id'].value;
var s = 'connect=1';
$.ajax({
type: "POST",
url: "process_facebook.php",
data: s,send **//Is this correct way to send s and send togather? I have tried with only 's' which works fine but dont know about both togather**
}).done(function(result) {
$("#fb-root").html(result);
});
}
有人可以协助如何在 javascript 函数中获取 mydata 并查看代码。