英特尔XDK -尝试从“探索服务”面板中使用Web服务时出错
Intel XDK - Error when trying to consume Web Service from Explore Services panel
我正在运行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
我一直想弄清楚发生了什么事,但我没有线索!
此错误可能是由于您没有指定一个函数来构建您通过Intel 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;
})
相关文章:
- 使用ajax将数据发布到asmx web服务并使用javascript函数在html页面中编写响应时出错
- 尝试将 AngularJS 服务用作构造函数时出错
- 通过 ajax 调用 wcf 服务时出错
- 尝试在 AngularJS 上对基本服务进行单元测试时出错
- "访问控制允许原点不允许原点为null"使用jQuery调用web服务时出错
- 联机运行web服务时出错
- Ember通知出错可以't读取属性“t”;“服务”;的未定义
- 尝试使用javascript使用Mashape Web服务时出错
- 通过Javascript创建服务活动时出错
- 在控制器中注入服务时出错
- 在Azure node.js应用程序服务中使用LevelDB时出错
- Chrome浏览器在angular web应用中刷新grunt服务时出错
- 执行依赖AWS cognito的angularjs服务的单元测试时出错
- AngularJS + NodeJS -调用注入服务时出错
- AngularJS:在工厂服务中添加$scope时出错
- 运行“Grunt服务”时出错.使用generator-angular-fullstack种子
- 从typescript调用Web服务时出错
- 使用示例服务在控制器之间传递数据时出错
- 将服务放在不同的js文件中时出错
- 英特尔XDK -尝试从“探索服务”面板中使用Web服务时出错