简体   繁体   English

加载文件 javascript 在 html 代码中不起作用

[英]load file javascript not working in html code

Here i want to load javascript in html code:在这里,我想在 html 代码中加载 javascript:

Html file in folder: Html 文件夹中的文件:

web/index.html

Javascript file in folder: Javascript 文件夹中的文件:

web/assets/script.js

Html load script code: Html 加载脚本代码:

<script type="type/javascript" href="assets/script.js">

You can't load script with href, try with this code:您无法使用 href 加载脚本,请尝试使用以下代码:

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

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

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