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).
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 plugin add cordova-plugin-mfp-jsonstore
Could you specify which version of 'cordova-plugin-mfp-jsonstore' your app is using (run command 'cordova plugin ls').
Did you follow this tutorial Link
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.