简体   繁体   English

在html上包含js文件

[英]include js file on html

At first, I'm sorry about my English :)) 一开始,我对我的英语很抱歉:))

I had some problems when i try to include file .js on index.html 我尝试在index.html上包含文件.js时遇到一些问题

<script src "../src/man/js/Generator.js"> </script>

but when i press F12 for debug, i get an error like: "failed to load '../src/man/js/Generator.js' from source/src/man/js/Generator.js" this is file's structure: 但是,当我按F12进行调试时,出现类似错误:“无法从source / src / man / js / Generator.js加载'../src/man/js/Generator.js'”,这是文件的结构:

在此处输入图片说明

so how can i deal this? 那我该怎么办呢?

您缺少=

<script src="../src/main/js/Generator.js"></script>

Oh, you must have check your Path. 哦,您必须检查一下您的路径。 <script src "../src/man/js/Generator.js"> </script> won't work. <script src "../src/man/js/Generator.js"> </script>无效。 but, <script src "../src/main/js/Generator.js"> </script> will work. 但是<script src "../src/main/js/Generator.js"> </script>可以使用。 Man, you forget the 'i' in 'main' 伙计,你忘了“主要”中的“我”

请添加等于src =“ path”

<script src="../src/man/js/Generator.js"> </script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM