简体   繁体   English

使用Komodo Editor 8.5,如何将一个具有javascript函数链接页面的项目创建为较大项目的一部分?

[英]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.

相关问题 作为更大的 Ruby on Rails 项目的一部分,我如何有条件地在 html.slim 文件中包含一些 Javascript? - How can I conditionally include some Javascript in an html.slim file, as part of a larger Ruby on Rails project? 如何使用 JavaScript 为我的计算器项目创建一个可以添加文本的框? - How to create a box where I can add text using JavaScript for my calculator project? 我如何使用 javascript 刷新页面的一部分 - How i can refresh a part of page using javascript 如何使用 bit 在 javascript 项目中创建 typescript 组件? - How do I create typescript components in a javascript project using bit? 如何使用 React-select 创建单独的 DropdownIndicator 组件,以便它可以在项目的其他部分重用 - How to create separate DropdownIndicator component using React-select so that it can be reused in other part of the project 如何使用Maven创建纯JavaScript项目? - How to create a pure JavaScript project using Maven? 如何使用 webpacker 使 Rails 6 项目中的页面可以访问 javascript 函数? - How do I make javascript functions accessible to pages in a Rails 6 project using webpacker? 使用Webstorm调试Django项目的javascript部分 - Debug the javascript part of Django project using Webstorm 我怎样才能使这个项目的视频部分工作? - how can I make the video part of this project work? 我如何使用javascript或php从Web浏览器中打印页面或页面的一部分而无需打印窗口 - how i can print a page or part of the page from web browser without print window using javascript or php
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM