简体   繁体   English

为什么我的 javascript 页面不会链接到我的 HTML 页面?

[英]Why won't my javascript page link to my HTML page?

I am having trouble linking my javascript to my HTML. I can get my CSS to link but the javascript won't?我无法将我的 javascript 链接到我的 HTML。我可以让我的 CSS 链接,但 javascript 不会? I have two javascript pages and both won't link.我有两个 javascript 页面,都不会链接。

Here's what I wrote in the HTML:这是我在 HTML 中写的:

<script src="js/question.js"></script>

<script src="js/app.js"></script>

Usually, this type of error concerns the path.通常,此类错误与路径有关。 Try to prepend a "/" to your path, like: <script src="/js/question.js"></script>尝试在您的路径前添加一个“/”,例如: <script src="/js/question.js"></script>

I am having trouble linking my javascript to my HTML.我无法将我的 javascript 链接到我的 HTML。 I can get my CSS to link but the javascript won't?我可以让我的 CSS 链接,但 javascript 不会? I have two javascript pages and both won't link.我有两个 javascript 页面,两者都不会链接。

Here's what I wrote in the HTML:这是我在 HTML 中写的:

<script src="js/question.js"></script>

<script src="js/app.js"></script>

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

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