Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
QtCreator HTML5从更高的目录链接javascript文件_Javascript_Html_Qt Creator - Fatal编程技术网

QtCreator HTML5从更高的目录链接javascript文件

QtCreator HTML5从更高的目录链接javascript文件,javascript,html,qt-creator,Javascript,Html,Qt Creator,在QtCreator中,HTML5应用程序: 我想在一个目录中链接一个js文件 说明:我试图将一个JS文件链接到与index.html相同的目录中 <script src="myjsfile.js" ></script> 似乎无法在我的电脑上工作 以下是我的文件结构: - Other files - html index.html - js entity.js My entity.js文件: funct

在QtCreator中,HTML5应用程序:

我想在一个目录中链接一个js文件

说明:我试图将一个JS文件链接到与
index.html
相同的目录中

<script src="myjsfile.js" ></script>
似乎无法在我的电脑上工作

以下是我的文件结构:

 - Other files
    - html
       index.html
    - js
       entity.js
My entity.js文件:

function hello() {
    alert("hello");
}
My index.html:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script src="../js/entity.js" ></script>
    </head>
    <body>
        <button onclick="hello()">X</button>
        <h1>Hello</h1>
    </body>
</html>

X
你好
如果有人能帮我。。。[如果这个问题很愚蠢,请原谅我]

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script src="../js/entity.js" ></script>
    </head>
    <body>
        <button onclick="hello()">X</button>
        <h1>Hello</h1>
    </body>
</html>