0

我正在运行 Ubuntu 15.04,当我尝试从 Intel XDK -> Explore Services 面板调用任何 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

我一直试图弄清楚发生了什么,但我不知道!

4

1 回答 1

0

此错误可能是由于您没有指定一个函数来构建您通过英特尔 XDK 进行的调用的 URL。

考虑到英特尔 XDK 在您尝试使用 Web 服务时创建的默认结构,您的 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;
})

于 2015-08-03T14:07:47.980 回答