JQuery的两个each方法的注意点

Jquery官网上两个each用法:

http://api.jquery.com/jQuery.each/

http://api.jquery.com/each/

 

使用时注意点

<!DOCTYPE html>
<html>
<head>
    <title>Untitled Page</title>
    <script type="text/javascript" src="jquery141.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $(null).each(function(i,n){不会报错
                alert(n.id);
            });
            //$.each(null,function(i,n){会报错
            //    alert(n.id);
            //});
        });
    </script>
</head>
<body>

</body>
</html>

 

posted @ 2014-07-11 13:40  nickycookie  阅读(508)  评论(0编辑  收藏  举报