来自后端服务的骨干请求 json(跨域)
我正在尝试使用backbone从后端服务请求json,我想请求数据然后将其解析为所需的客户端结构,所以我想知道为什么下面的简单示例没有调用后端服务:
Book = Backbone.Model.extend({});
Books = Backbone.Collection.extend({
model: Book,
url: 'http://foobar.cloudapp.net/contents',
parse: function (response) {
return response;
}
});
function default_start_up() {
var books = new Books();
books.fetch();
};
I'm trying to request the json from the backend service using backbone, I want to request the data and then parse it into the required client side structure, so I want to know why the following simple example does not make a call out to the backend service:
Book = Backbone.Model.extend({});
Books = Backbone.Collection.extend({
model: Book,
url: 'http://foobar.cloudapp.net/contents',
parse: function (response) {
return response;
}
});
function default_start_up() {
var books = new Books();
books.fetch();
};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经成功使用了这个jquery插件 跨域ajax
I've used this jquery plugin with success cross domain ajax