Ember.js 余烬数据发送html格式,而不是在手机中使用(phonegap)
我正在测试我的移动应用程序中的余烬+余烬数据。我使用的是1.0和1.0.0.beta2版本。当我做一个简单的发现Ember.js 余烬数据发送html格式,而不是在手机中使用(phonegap),ember.js,ember-data,Ember.js,Ember Data,我正在测试我的移动应用程序中的余烬+余烬数据。我使用的是1.0和1.0.0.beta2版本。当我做一个简单的发现 App.\uuuuu容器\uuuuuu.lookup('store:main')。find('admin\u users') ember正在将请求格式设置为html而不是json。我试过使用basic$.get,我有一个json请求,没有问题。它只发生在余烬数据中 添加这个解决了我的问题 DS.RESTAdapter.reopen({ headers: { "Accep
App.\uuuuu容器\uuuuuu.lookup('store:main')。find('admin\u users')
ember正在将请求格式设置为html而不是json。我试过使用basic$.get,我有一个json请求,没有问题。它只发生在余烬数据中 添加这个解决了我的问题
DS.RESTAdapter.reopen({
headers: {
"Accept": "application/json, text/javascript; q=0.01"
}
});
加上这个解决了我的问题
DS.RESTAdapter.reopen({
headers: {
"Accept": "application/json, text/javascript; q=0.01"
}
});
您能展示一下如何使用jquery运行ajax调用吗?Url、参数等$.get('http://'+BACKEND_HOST+'/api/users/'+showId+'.json',function(data){users=data['users']})这是我用于web应用的后端,它也在ember中。js您是否设置DS.restapter的
名称空间和主机属性?请参阅该链接中的端点路径自定义
部分是的,我已将它们都设置好。在rails中,我看到在2013-09-13 15:27:50+0200时192.168.0.17的请求Started GET”/api/artist\u profiles“,由api::ArtistProfilesController处理,索引为HTML完成406,在1ms中是不可接受的ActionController::UnknownFormat(ActionController::UnknownFormat):
您能展示一下如何使用jquery运行ajax调用吗?Url、参数等$.get('http://'+BACKEND_HOST+'/api/users/'+showId+'.json',function(data){users=data['users']})这是我用于web应用的后端,它也在ember中。js您是否设置DS.restapter的名称空间和主机属性?请参阅该链接中的端点路径自定义
部分是的,我已将它们都设置好。在rails中,我看到在2013-09-13 15:27:50+0200时192.168.0.17的请求Started GET”/api/artist\u profiles“,由api::ArtistProfilesController处理,索引为HTML完成406,在1ms中不可接受ActionController::UnknownFormat(ActionController::UnknownFormat):