在& lt;/body& gt;关闭之前,将我的脚本标签放置在何处或之后 [英] where to place my script tag before closing of</body> or after it

查看:61
本文介绍了在& lt;/body& gt;关闭之前,将我的脚本标签放置在何处或之后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

众所周知,我们必须在页面末尾包含外部jsscript文件.出于性能和可用性的目的.

As we many of know that we have to include external jsscript file at the end of page. for performance and usability purpose.

我想知道正确的放置位置.

I want to know the correct place where to place it.

表示

<boby>
<!--html here -- >
<script src= ""> <!--  here ???  -- >
</body>
<script src= ""><!--  here ???  -- >

在script标签关闭之前或在script关闭之后.将身体标签置于内部或超出外部标签是否有任何优势.

before the closing of script tag or after the closing of script . Is there any avantage of putting inside or outisde of body tag.

先谢谢了.

推荐答案

将其放在之后甚至都不是一个选择,脚本标记不能放到那里.这将导致无效的HTML文档.

Placing it after the body isn't even an option, script tags cannot go there. That would result in an invalid HTML document.

这篇关于在&amp; lt;/body&amp; gt;关闭之前,将我的脚本标签放置在何处或之后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆