gpt4 book ai didi

javascript - ./和/in <script> src 属性之间有什么区别吗?

转载 作者:行者123 更新时间:2023-11-30 11:04:49 26 4
gpt4 key购买 nike

<分区>

给定以下项目结构:

/root
/static
script.js
page.html

这将“导入script.js , 进入 HTML 文件:

<html>
<head>
<script src="/static/script.js"></script>
</head>
<body>
...
</body>
</html>

这也将:

<html>
<head>
<script src="./static/script.js"></script>
</head>
<body>
...
</body>
</html>

我在想:

  1. 一种方式优于另一种方式吗?
  2. 有没有什么情况,当/./ ,在她src <script> 的属性会有不同的表现吗?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com