外部.js文件是否需要< script>标签? [英] Does an external .js file require <script> tags?

查看:185
本文介绍了外部.js文件是否需要< script>标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

外部.js文件是否需要内部和包含标记?

Does an external .js file require internal and containing tags to work?

推荐答案

不需要它们,事实上,如果包含它们,您将收到语法错误。

No they're not needed, in fact you'll get a syntax error if you include them.

您的 .js 文件应该只包含 JavaScript,周围没有HTML标签,就像在页面内一样。

Your .js files should contain only JavaScript, no HTML tags around it, like would have inside a page.

这篇关于外部.js文件是否需要< script>标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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