How to detect if DOMContentLoaded was fired

前端 未结 6 1931
误落风尘
误落风尘 2020-12-02 14:00

I\'m trying to help developing a library and for it I\'m trying to work with page loading.
In the process I want to make the library completely compatible with the use o

6条回答
  •  遥遥无期
    2020-12-02 14:42

    Here is the thing, if some other library (such as jQuery) already used DOMContentLoaded, you can't use it again. That can be bad news, because you end up without being able to use it. You are gonna say, why not just use $(document).ready(), because, NO!, not everything needs to use jQuery, specially if it is a different library.

提交回复
热议问题