在关闭< / body"之前,将我的脚本标签放置在哪里。或之后 [英] where to place my script tag before closing of</body> or after it

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

问题描述

众所周知,我们必须在页面末尾包含外部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 ???  -- >

在脚本标记关闭之前或脚本关闭之后。有没有将人体标签放入内部或外部的优势。

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.

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

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