Skip to content

Commit

Permalink
Fixup replacement of jquery ready()
Browse files Browse the repository at this point in the history
  • Loading branch information
mmore500 committed Apr 18, 2024
1 parent 5bc6698 commit 38919d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/emp/web/events.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ namespace web {
(void) fun_id;

MAIN_THREAD_EM_ASM({
document.addEventListener('DOMContentLoaded', function() {
if (document.readyState !== 'loading') emp.Callback($0);
else document.addEventListener('DOMContentLoaded', function() {
emp.Callback($0);
});
}, fun_id);
Expand Down

0 comments on commit 38919d6

Please sign in to comment.