src中的路径以到达不同目录中的文件 [英] Path in src to reach a file in a different directory
本文介绍了src中的路径以到达不同目录中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个名为 projects
的文件夹,其中有一个游戏
文件夹和引擎
文件夹。我在引擎
文件夹中有我的 engine.js
文件,我想知道我是否可以用我的<$访问它来自其他文件夹的c $ c> game.html 文件
I have a folder called projects
and in it I have a game
folder and an engine
folder. I have my engine.js
file inside the engine
folder and I was wondering if I could access it with my game.html
file from the other folder like so
<script type ="text/javascript" src ="\engine/engine.js"/>
现在,显然上面的内容不起作用,但我需要做的就是回去项目
文件夹中的游戏
文件夹,然后进入引擎
文件夹。
Now, obviously the above doesn't work, but what I need to do is go back out of the game
folder to the project
folder and then into the engine
folder.
文件树:项目文件夹
- 项目
- 引擎
- engine.js
- game.js
src的正确格式是什么
为用户提供engine.js
的链接?推荐答案
使用双点返回:
src =../ engine / engine.js
这篇关于src中的路径以到达不同目录中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- 引擎
查看全文