(1)使用JS标签中
案例:
<script type="text/javascript">
document.write("<h1>文祥,i love you !</h1>");
</script>
(2)外部JS文件
案例:
html中:
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="js/a.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
引入JavaScript的三种方式?
最新推荐文章于 2024-02-29 20:24:05 发布