这有效,但它在调用期间冻结页面:
getAllNewEstate: function(callback) {
function NewEstateData() {};
var items = Backendless.Persistence.of( NewEstateData ).find().data;
callback(items)
},
如何进行异步调用?
文档: http : //backendless.com/documentation/data/js/data_sync_and_async_calls.htm http://backendless.com/documentation/data/js/data_basic_search.htm
更新
我试过了:
getAllNewEstate: function(callback) {
function NewEstateData() {};
Backendless.Persistence.of( NewEstateData ).find( function(e) {
console.log('event', e);
callback(e.data);
});
},
// 没有错误,没有 console.log,
getAllNewEstate: function(callback) {
Backendless.Persistence.of( NewEstateData ).find( function(e) {
console.log('event', e);
callback(e.data);
});
},
// 未捕获的 ReferenceError:未定义 NewEstateData