How do I call a method after a ajax fetch has been done?
This is my code so far, but the callback method wont find this.display.
class fourViews {
static display(data){
// Some stuff being displayed...
}
loadPage(){
let url = "www.example.com";
fetch(url).then(function(data) {
this.display(data);
}).catch(function(error) {
// If error.
});
}
}