在项目中使用jquery的bind方法遇到一种情况:(问题的简单示例)

<html>

    <head>

        <title>test jquery bind event</title>

        <script src="jquery-1.6.2.min.js"></script>

    </head>

    <body>

        <a href="#" id="tbind">click</a>

        <script>

            var handle = function () {

                alert('binding');

            };

            $(function () {

                $('#tbind').bind('click', handle);

                $('#tbind').bind('click', handle);

                $('#tbind').bind('click', handle);

                $('#tbind').bind('click', handle);

            });

        </script>

    </body>

</html>

DOM加载完成后,在同连接上连续绑定4个click事件,但是这4个事件都指向同一个

handle,个人认为当点击连接时只会弹出一个alert。但是上面这样的代码会弹出4个

alert。想了好久没有找到问题的根本。后来在bind前面加了个unbind哎!