Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/470.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
javascript返回值问题_Javascript_Jquery_Reactjs_Reactjs Flux - Fatal编程技术网

javascript返回值问题

javascript返回值问题,javascript,jquery,reactjs,reactjs-flux,Javascript,Jquery,Reactjs,Reactjs Flux,我在Reactjs中有JavaScript应用程序。代码如下 var fnlValue; var ReportStore = assign({}, EventEmitter.prototype, { reportMemberList: function(projectId) { obj.projectMember(projectId, function(repose) { fnlValue = repose; });

我在Reactjs中有JavaScript应用程序。代码如下

var fnlValue;
var ReportStore = assign({}, EventEmitter.prototype, {
    reportMemberList: function(projectId) {
        obj.projectMember(projectId, function(repose) {
            fnlValue = repose;
        });
        return fnlValue;
    }
}
obj.projectMember
是服务器端调用。只有在从服务器端获取数据后,我才需要返回
fnlValue
。此处使用回调,但会生成错误

Uncaught TypeError: callback is not a function 

错误正在查找名为
回调
的内容。这是否用于
obj.projectMember
中?是。我在obj.projectMember()中使用了。那么,您可以显示错误实际发生的位置吗?您还没有发布失败的代码。问题可能是由于调用了
obj.projectMember
。使用JavaScript调试器单步执行代码以查看错误。即使回调正在工作,如果函数的值是异步确定的,则不能
返回该值。有关更多信息,请参阅。