On pageload i am firing a function that should open a lightbox. In Chrome, FF, Opera, Edge and Safari everything works as it intented. In IE11 however it is not. I am not getting a warning or error in the console so I have no clue what I am doing wrong here.
I stripped the code below to the essential. In Chrome (and other browsers) the console log goes from 1 to 3 to 2. In IE11 i am only getting 1 and I have no idea why it doesn't go to 3 or 2. I thought it had something to do with bind(), but that seems to be supported.
I have to admit I am pretty new with constructors, prototypes and bind.
constructor(el) {
this.$el = $(el);
console.log('1');
this.getLocation = getLocation.bind(this);
this.loadLB();
console.log('2');
}
loadLB() {
const url = new URL(window.location.href);
console.log('3');
this.getLocation('url');
}
Are you using ConstructorMethod? It's also not supported by IE. I don't know if you have used some polyfills to make it work in IE 11.
Besides, IE doesn't support URL() constructor. You can add this polyfill to make URL()
work in IE 11:
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>