1 内嵌式
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script> JS脚本</script>
</head>
<body>
</body>
</html>
2 导入式
(1)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="XXX.js"></script>
</head>
<body>
...
</body>
</html>
注意:一般将script标签放在</body>之前,这样可以更快地加载页面。原因