[英]WL.JSONStore is undefined error in IBM mobilefirst
I am getting WL.JSONStore is undefined error in mobile browser simulator while I am trying to use JSONStore in my mobile application.I am using IBM mobilefirst (version 8.0.0-2017091111). 我正在尝试在移动应用程序中使用JSONStore时,在移动浏览器模拟器中得到WL.JSONStore是未定义的错误。我正在使用IBM mobilefirst(版本8.0.0-2017091111)。
function wlCommonInit(){
WL.JSONStore.init(collections, options).then(function () {
alert("intialized successfully");
}).fail(function (errorObject) {
alert("failed to initialize collection\n"+ JSON.stringify(errorObject));
});
document.getElementById("btn_submit").addEventListener("click", onSubmit, false);
}
function onSubmit(){
var collectionName="people";
var data={firstName:$('#first').val(),middleName:$('#middle').val(),lastName:$('#last').val()};
WL.JSONStore.get(collectionName).add(data, options).then(function () {
alert("added data successfully");
}).fail(function (error) {
});
}
Add cordova jsonstore plugin 添加cordova jsonstore插件
cordova plugin add cordova-plugin-mfp-jsonstore
See more: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/jsonstore/cordova/#adding-jsonstore 查看更多: https : //mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/jsonstore/cordova/#adding-jsonstore
https://www.npmjs.com/package/cordova-plugin-mfp-jsonstore https://www.npmjs.com/package/cordova-plugin-mfp-jsonstore
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.