The issue in your code might be due to the incorrect usage of the call_back_fun function. It seems that you are trying to call the call_back_fun function with the content parameter, but the content is not being passed correctly.\n\nTo fix the issue, you can modify your code as follows:\n\njavascript\nstopScanMap: async function (agvId, call_back_fun) {\n var res = await getAgvModule().stopSlam(agvId, (res, content) => {\n call_back_fun(content); // Pass the content as an argument to the callback function\n });\n return res;\n}\n\nwebApi.stopScanMap(25, function (content) {\n console.log("停止扫图", JSON.stringify(content));\n // Make sure that the `content` variable is not `undefined`\n});\n\n\nThis should ensure that the content variable is passed correctly to the call_back_fun function and prevent it from being undefined.

JavaScript Callback Function Issue: Passing 'content' Parameter Correctly

原文地址: https://www.cveoy.top/t/topic/qnWS 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录