I don’t know why the methods returns always [Object object]. My code it’s here:
function SetDataDB(){
alert(new DatabasePlugin.get_account_profiles('settings_account'));
}
var DatabasePlugin = {
insert_account_profiles : function(array, parameter){
window.localStorage.setItem(parameter, array);
},
get_account_profiles: function(parameter){
return "Hola";
}
};
It always returns me an object but not specified. What do I have to do?
Try this:
I’m assuming the
get_account_profilesof aDatabasePlugininstance returns a string.EDIT: As per your edit, you need to define the object before you access its properties. Make sure
DatabasePluginis accessible in the scope you are invokingSetDataDBin.