<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts/map/js/china.js"></script>
</head>
<body>
<div>Hello World</div>
<div id="map" style="width: 600px; height: 400px"></div>
</body>
</html>
src
会将内容嵌入到网页中,替换 script 标签的内容,如果 script 标签加载 js 脚本,资源是国外的,少说也要十多秒钟加载时间,而在此期间浏览器页面是空白的,不会显示任何内容。因此,一般是在 html 底部加载 js 脚本。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<div>Hello World</div>
<script src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts/map/js/china.js"></script>
</body>
</html>
标签:src,HTML,script,href,Document,Hello,加载
From: https://www.cnblogs.com/Himmelbleu/p/18408645