[英]Using Komodo Editor 8.5, How can I create a project that has a linked page for javascript functions as part of a larger project?
Sorry for the basic question, I'm a beginner with some basic knowledge of html, css and beginning with javascript that I'm learning for developing my own web project. 对不起这个基本问题,我是一个初学者,具有一些html,css的基础知识,并且从我正在学习的javascript开始发展自己的Web项目。 I'm trying to create a project with a separate page for functions to keep the page cleaner and see all the functions in one place.
我正在尝试创建一个具有单独页面的功能项目,以使页面保持整洁并在一个位置查看所有功能。 I'm watching videos as part of an online course.
我正在观看视频,这是在线课程的一部分。 However, the lectures use Visual Studio in which you can drag and drop the files so that the source link is already coded.
但是,讲座使用Visual Studio,您可以在其中拖放文件,以便对源链接进行编码。 If there's an equivalent feature, let me know please.
如果有等效功能,请告诉我。
I know that you are supposed to link the <script type = "text/javascript" script src = XXXX.js>
However, whenever I copy the file path, it still doesn't come up. 我知道您应该链接
<script type = "text/javascript" script src = XXXX.js>
但是,每当我复制文件路径时,它仍然不会显示。 What am I missing? 我想念什么?
This should be the text that links your JS file: 这应该是链接您的JS文件的文本:
<script type="text/javascript" src="path/to/file.js"></script>
Even though with HTML5 you might not need quotes around your attribute content, it's safe to put them in for older browsers. 即使使用HTML5,您可能不需要在属性内容两边加上引号,但将它们放在较旧的浏览器中是安全的。 Don't put a space between the attribute name and the equals sign, or between the attribute content and the equals sign.
在属性名称和等号之间,或在属性内容和等号之间不要留空格。 There shouldn't be a
script
in the middle of your tag (you put one before src
). 标签中间不应包含
script
(您可以在src
之前放置一个script
)。 Make sure the file path is relative to your HTML file as well. 确保文件路径也相对于HTML文件 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.