您想访问位于当前文件夹上一级文件夹中的文件夹中的文件,因此您应该执行以下操作:
<script src="../script/import.js"></script>
I'm assuming that you are using Flask for your app, in which case you will need to serve your javascript files as 'static' files, see: https://flask.palletsprojects.com/en/1.1.x/tutorial/static/
Move your 'script' folder into a new folder called 'static', then change your script import to:
<script type="text/javascript" src="{{ url_for('static', filename='script/import.js') }}"></script>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.