<脚本>标签必须包含单独的< / script>标签? [英] <script> tag must include separate </script> tag?

查看:145
本文介绍了<脚本>标签必须包含单独的< / script>标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天注意到在进行一些测试时,我关闭< script> 标记的方式会使我的页面成为或中断。例如,这有效:

I noticed today while doing some testing that the way I close my <script> tag either makes or breaks my page. For example, this works:

<script src="scripts/jquery.js" type="text/javascript"></script>

但这不是:

<script src="scripts/jquery.js" type="text/javascript" />

当我使用IE的开发人员工具时,该文件似乎显示出来,但似乎它被忽略了。有没有人见过这个或知道它为什么会发生?提前致谢!

The file appears to show up when I use IE's Developer Tools, but it seems like it just gets ignored. Has anyone ever seen this or know why it might be happening? Thanks in advance!

推荐答案

您必须包含结束脚本标记。即使您只包含外部脚本,脚本元素也不会自动关闭。

You must include a closing script tag. The script element is not self closing, even when you're only including an external script.

这篇关于&LT;脚本&GT;标签必须包含单独的&lt; / script&gt;标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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