Is $(document).ready necessary?

前端 未结 5 2055
太阳男子
太阳男子 2020-11-22 15:07

I saw this question in stackoverflow but do not feel that it was answered at all.

Is $(document).ready necessary?

I link all my javascripts at t

5条回答
  •  春和景丽
    2020-11-22 15:59

    I have seen references/blog post across the internet regarding the usage of jquery's document.ready. In my opinion both using it or putting all your javascript at the bottom of the page are both valid. And now the question would be which would be better? It is just a matter of programming style.

提交回复
热议问题