I have code which is written:
window.addEventListener("orientationchange", function() {
//code here;
}, false);
And it works fine...but I am being told to add by the Mozilla dev page:
elem.dispatchEvent(event);
Can anyone tell me why I need to add the dispatch and why it is working without it (what the dispatch actually does would also be very useful!).
W3C also recommends in the specification to remove an event when done with it, but for an orientation change it could happen at any time, is it OK to leave it there?
Much obliged for any help.
elem? What isevent? Which MDN page?