エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Async-loaded scripts with DOMContentLoaded or load event handlers not being called?
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Async-loaded scripts with DOMContentLoaded or load event handlers not being called?
I've got a script with a DOMContentLoaded event handler— document.addEventListener('DOMContentLoa... I've got a script with a DOMContentLoaded event handler— document.addEventListener('DOMContentLoaded', function() { console.log('Hi'); }); Which I'm loading asynchronously— <script async src=script.js></script> However, the event handler is never called. If I load it synchronously— <script src=script.js></script> It works fine. (Even if I change the DOMContentLoaded event to a load event, it's nev