This is my code:
function User(){
this.nickname='nickname';
}
User.prototype.save=function(){
dosomething();
};
User.prototype.add=function(){
navigator.geolocation.getCurrentPosition(function(positon){
this.save();
});
};
but this.save()
is wrong, I want to call save()
in another callback. I find this isn't pointing to the User, how can I call save()
correctly?