jQuery的hello world案例

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>jQuery库</title>
    <script src="js/jquery-3.2.1.js"></script><!--引入jQuery库-->
    <script>
          $(document).ready(function(){
              alert("hello world!!");
          });
    </script>
</head>
<body>
      
</body>
</html>

$(document).ready(function{ })  和 window.onload=function() 等价

猜你喜欢

转载自blog.csdn.net/weixin_42044486/article/details/84142341