[removed] and $(document).ready

后端 未结 4 1343
囚心锁ツ
囚心锁ツ 2020-12-14 14:50

According to http://caniuse.com/script-defer, most browsers support the script tag\'s defer attribute.

I would like to know if scripts spec

4条回答
  •  无人及你
    2020-12-14 15:26

    The defer attribute has a good write-up and analysis. Also See the comments to the post for additional info on how defer has been re-defined in HTML5.

    My conclusion: defer is too browser dependent to count on. Therefore use the jQuery doc ready technique.

    To put it another way, an important reason for jQuery is to cover browser inconsistencies. Defer is another such inconsistency that should be avoided for well written pages.

提交回复
热议问题