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>之前,如许能够更快地加载页面。缘由