-Tony

jQuery 入口函数主要有4种写法

jqery  入口函数主要有4种写法,其中以第3种方法最为方便。

<!DOCTYPE html>
<html lang="en">
<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>Document</title>
    <script src=\'js/jquery-1.12.4.js\'></script>
    <script>
        //1.
        $(document).ready(function(){
            alert(\'1111\');
        })

        //2.
        jQuery().ready(function(){
            alert(\'222\');
        })

        //3.
        $(function(){
            alert(\'gogo\');
        })

        jQuery(function(){
            alert(\'hoho\');
        })
        
    </script>
</head>
<body>
    
</body>
</html>

 

分类:

技术点:

相关文章:

  • 2022-01-08
  • 2022-01-08
  • 2022-01-08
  • 2021-12-28
  • 2022-01-08
  • 2022-01-08
  • 2022-01-08
  • 2022-01-08
猜你喜欢
  • 2022-01-08
  • 2022-01-08
  • 2022-01-08
  • 2022-01-08
  • 2022-01-08
  • 2021-12-28
相关资源
相似解决方案