Skip to content

Commit

Permalink
Use legacy JS instead of event handlers
Browse files Browse the repository at this point in the history
Legacy browsers and 'embedded' browsers like the one in Office do not always support event handlers
  • Loading branch information
tvdijen authored Oct 30, 2024
1 parent af35df5 commit b12d13b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/resources/public/post.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
document.addEventListener("DOMContentLoaded", function () {
window.handleState = function handleState() {
if (document.readyState === 'interactive' || document.readyState === "complete") {
document.forms[0].submit();
});
}
};
document.onreadystatechange = window.handleState;

0 comments on commit b12d13b

Please sign in to comment.