首页 > Web开发 > 详细

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

时间:2018-06-30 19:34:32      阅读:202      评论:0      收藏:0      [点我收藏+]

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>

 

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

原文:https://www.cnblogs.com/-Tony/p/9248345.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!