【问题标题】:netbeans web application error 404 include a jsnetbeans web 应用程序错误 404 包含一个 js
【发布时间】:2018-01-02 13:45:33
【问题描述】:

我使用 Netbeans 8.2 并创建了一个 Web 应用程序。我有一个html和一个js。 html是

<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <div>TODO write content</div>
        <script type="text/javascript" src="js1.js"></script>
    </body>
</html>

项目的结构是

我想包含 js1.js。

当我在浏览器的控制台中运行应用程序时,我得到一个 404

GET http://localhost:8080/Prueba/js1.js [HTTP/1.1 404 Not Found 2ms]

为什么我会得到这个 404?

【问题讨论】:

    标签: javascript netbeans get http-status-code-404


    【解决方案1】:

    文件 js1.js 必须在 web 目录内(在 netbeans 中),而不是在图片中显示的外部

    【讨论】:

      猜你喜欢
      • 2021-08-26
      • 2016-10-11
      • 2017-11-12
      • 1970-01-01
      • 1970-01-01
      • 2022-10-01
      • 2011-01-13
      • 2016-04-19
      • 1970-01-01
      相关资源
      最近更新 更多