javaspript学习

JavaScript的学习

1、JavaScript是什么?

javaScript是一门世界上最流行的脚本语言 Java

2、快速入门

2.1、引入JavaScript

1、内部标签

 <script> 
     //....
 <script>
 

2、外部引入
hj.js

 aert("hello,world");

test.html

  <!--外部引入
         注意:script必须成对出现
     -->
     <script src="js/hj.js"></script>
 
     <!--不用显示定义type,也默认就是javaScript-->
     <script type="text/javascript"></script>
 

测试代码

 <!DOCTYPE html>
 <html lang="en">
 <head>
     <meta charset="UTF-8">
     <title>Title</title>
     <!--script标签内,写Javascript代码-->
     <!--<script>
         alert("hello,world");
     </script>-->
 
     <!--外部引入
         注意:script必须成对出现
     -->
     <script src="js/hj.js"></script>
 
     <!--不用显示定义type,也默认就是javaScript-->
     <script type="text/javascript"></script>
 </head>
 <body>
 
 
 <!--这里也可以存放-->
 </body>
 </html>
posted @ 2021-11-01 11:22  骑蜗牛环球  阅读(103)  评论(0)    收藏  举报