我正在运行Ubuntu 15.04,当我尝试从英特尔XDK -> Explore服务面板调用任何web服务时,得到的响应如下:
undefined is not a function
TypeError: undefined is not a function at intel.xdk.services.iodocs_.exports.bindCommon (http://127.0.0.1:58889/http-services/api-explorer/iodocs/api-request-common.js:60:14)
at http://127.0.0.1:58889/http-services/api-explorer/iodocs/tryit?functionName=tryIt1433289861198&apiName=db_core&isDebug=true&code=intel.xdk.services.tryIt1433289861198+%3D+intel.xdk.services.iodocs_.bindCommon.bind%28null%2C+%22intel.xdk.services.tryIt1433289我一直在试图弄清楚发生了什么,但我一点头绪都没有!
发布于 2015-08-03 22:07:48
出现此错误的原因可能是您没有指定函数来构建通过英特尔XDK进行的调用的URL。
当您尝试使用web服务时,考虑到intel XDK创建的默认结构,您的js文件中应该有如下内容。
(function (credentials, helpers) {
var exports = {};
exports.YourMethodName = function(params) {
var url = 'YourURLWithoutParameters'
if (params) url = url + '?' + $.param(params);
return $.ajax({url: url, type: 'GET'});
};
return exports;
})
https://stackoverflow.com/questions/30610187
复制相似问题