In my code, I do the following (very simplified):
class AddOrSelectAddress {
static body; // <-- Error
static async open() {
await $.get(basePath + 'Manage/AddOrSelectAddress', null, result => {
this.body = document.createElement('div');
this.body.innerHTML = result;
});
// ...
}
static someOtherMethod() {
// do something with body
}
}
My code works fine in Chrome. Firefox, though, complaints an error in the second line of code:
SyntaxError: bad method definition
I'm relatively new to class-based JavaScript programming. What am I doing wrong here?
Static variables in JavaScript doesn't really help me, because it mainly uses old syntax.