Using DOMContentReady considered anti-pattern by Google

后端 未结 7 2238
广开言路
广开言路 2020-12-08 05:20

A Google Closure library team member asserts that waiting for DOMContentReady event is a bad practice.

The short story is that we don\'t want to wai

7条回答
  •  北海茫月
    2020-12-08 05:36

    That's probably because Google doesn't care if you don't have Javascript, they require it for just about everything they do. If you use Javascript as an addition on top of your already-functioning website then loading scripts in DOMContentReady is just fine. The point is to use Javascript to enhance the user's experience, not seclude them if they don't have it.

提交回复
热议问题