【发布时间】:2014-11-20 19:57:16
【问题描述】:
我想使用 for 循环添加到 JSONStore
所以我在 for 中调用了长度超过 500 的 saveToJSON() 函数,但它没有添加,并且在控制台中它显示成功,但是当我查看 jsonstore 时什么都没有,以及循环次数我调用添加到 jsonstore 在控制台中的红色气泡中。
function saveToJSON(object) {
var data ={
title : object.title,
subtitle: object.subtitle,
};
var options = {}; //default
WL.JSONStore.get('MyDataCollection').add(data, options)
.then(function () {
//handle success
console.log("add JSONStore success");
})
.fail(function (errorObject) {
//handle failure
console.log("add JSONStore failure");
});
}
【问题讨论】:
标签: javascript html ibm-mobilefirst jsonstore