Is it wrong to place the [removed] tag after the </body> tag?

前端 未结 8 1000
长情又很酷
长情又很酷 2020-11-22 06:12

How wrong is it to place the script tag after the closing tag of the body (). ?


  ....
  
     ....
  <         


        
8条回答
  •  粉色の甜心
    2020-11-22 06:27

    Modern browsers will take script tags in the body like so:

    
        
    
    

    Basically, it means that the script will be loaded once the page has finished, which may be useful in certain cases (namely DOM manipulation). However, I highly recommend you take the same script and put it in the head tag with "defer", as it will give the same effect.

    
        
    
    

提交回复
热议问题