What's the difference between putting script in head and body?

后端 未结 9 978
花落未央
花落未央 2020-12-04 12:15

I was getting a problem .


  

        
9条回答
  •  庸人自扰
    2020-12-04 12:50

    When scripts are included in the head they load or run before the content of the page. When you include them in the body they load or run after the preceding html. It's usually good practice to put scripts as close to the end of the body as possible.

提交回复
热议问题