我已經成立了一個當地的環境,在那裏我從JSON文件加載數據CouchDB的跨域:如何訪問從angularjs
var Players = $resource('data/players.json');
var players = Players.query(function(){});
而且它的偉大工程。
現在我想要訪問不同域(http://playball.iriscouch.com/players)上的CouchDB,並且基於google buzz示例,我嘗試了以下操作,但是我無法做到這一點工作:
var Players = $resource('http://playball.iriscouch.com/players',
{alt: 'json', callback: 'JSON_CALLBACK'},
{get: {method: 'JSON'}
});
var players = Players.query(function(){});
我只是收到一個空數組...任何想法?
謝謝你!
淑娜
這可能有所幫助:http://kxepal.iriscouch.com/docs/1.3/features/cors.html – Costa 2013-04-13 22:23:31