我用一个Cordova plugin其中有两个回调函数:调用函数抛出错误的角度
window.plugins.screensize.get(this.screensize_success, this.screensize_error);
接下来,在成功回调,我做的:
screensize_success(result)
{
console.log(result); // <--- works fine
console.log("##### height: "+result.height); // <--- works fine
this.get_highest(result); // <--- throws an error
}
get_highest(result)
{
return Math.max(result.height,result.width);
}
我得到这个错误:
Uncaught (in promise): TypeError: Cannot read property 'get_highest' of null
我在做什么错?