Last active
September 14, 2021 02:39
-
-
Save wtnabe/60706694f292432dd0872f3ac3309d65 to your computer and use it in GitHub Desktop.
HTMLページ読み込み時のwindowとdocumentのeventの並び
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.readyState: interactive | |
Stimulus.Controller: connect | |
document: DOMContentLoaded | |
document.readyState: complete | |
window: load | |
window: pageshow |
Author
wtnabe
commented
Sep 14, 2021
•
- Form などブラウザがキャッシュから再構築する際に、再構築に関する event は今のところ見つけられていない
- event がダメなら MutationObserver でなんとかならないかと思ったけど、よい方法は見つかっていない(autocomplete="off" でよいならそれがいちばん)
- 再構築後の Form の value は DOMContentLoaded のタイミングでは取得できない
- window.load 以降なら恐らく取得できる(window.pageshow で紹介している記事や Stack Overflow の回答などは散見される)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment