假设我有这种情况...
function b()
{
var nameofafile;
var rtr=a(nameofafile);
console.log(rtr); //The path should come here, but returns undefined
}
function a(nameofafile)
{
gapi //....blablabla
request.execute(function(resp){
//severalthingsdone
console.log(path)
return path; //Here i want to do the return to "function a" the path of a file in the Drive that i'm already logging correctly
});
}
该请求负责返回命令的“功能a”的可见性受损? 我该如何绕路呢?