Namespaces custom live events broken in 1.4

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Namespaces custom live events broken in 1.4

Adam Tistler
It seems that something has changed regarding namespaced live()
events.  Looks broken to me:

Test case:

<html>
<head>
    <script type="text/javascript" src="/js/jquery.js"></script>

    <script type="text/javascript">
    $(document).ready(function() {

    $('#mydiv').bind('click', function(ev) { console.log("click"); });
    $('#mydiv').bind('click.goodbye', function(ev) { console.log
("click.goodbye"); });
    $('#mydiv').bind('goodbye', function(ev) { console.log
("goodbye"); });
    $('#mydiv').bind('hello.goodbye', function(ev) { console.log
("hello.goodbye"); });

    $('#mydiv').trigger('click');
    $('#mydiv').trigger('click.goodbye');
    $('#mydiv').trigger('goodbye');
    $('#mydiv').trigger('hello.goodbye');

    });
    </script>
</head>
<body>
    <div id="mydiv">My DIV</div>
</body>
</html>



1.3.2 results (as expected):

click
click.goodbye
click.goodbye
goodbye
hello.goodbye


1.4 results (BAD):

click
click
goodbye


1.4 results ( replacing live() with bind() ):

click
click.goodbye
click.goodbye
goodbye
hello.goodbye

--
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.


Reply | Threaded
Open this post in threaded view
|

Re: Namespaces custom live events broken in 1.4

John Resig
Administrator
We've been discussing this over on the new forum:
http://forum.jquery.com/topic/event-special-namespacing-bug

(live events used the special add, which is causing this problem to occur)

--John



On Tue, Jan 19, 2010 at 3:45 PM, gobagoo <[hidden email]> wrote:

> It seems that something has changed regarding namespaced live()
> events.  Looks broken to me:
>
> Test case:
>
> <html>
> <head>
>    <script type="text/javascript" src="/js/jquery.js"></script>
>
>    <script type="text/javascript">
>    $(document).ready(function() {
>
>    $('#mydiv').bind('click', function(ev) { console.log("click"); });
>    $('#mydiv').bind('click.goodbye', function(ev) { console.log
> ("click.goodbye"); });
>    $('#mydiv').bind('goodbye', function(ev) { console.log
> ("goodbye"); });
>    $('#mydiv').bind('hello.goodbye', function(ev) { console.log
> ("hello.goodbye"); });
>
>    $('#mydiv').trigger('click');
>    $('#mydiv').trigger('click.goodbye');
>    $('#mydiv').trigger('goodbye');
>    $('#mydiv').trigger('hello.goodbye');
>
>    });
>    </script>
> </head>
> <body>
>    <div id="mydiv">My DIV</div>
> </body>
> </html>
>
>
>
> 1.3.2 results (as expected):
>
> click
> click.goodbye
> click.goodbye
> goodbye
> hello.goodbye
>
>
> 1.4 results (BAD):
>
> click
> click
> goodbye
>
>
> 1.4 results ( replacing live() with bind() ):
>
> click
> click.goodbye
> click.goodbye
> goodbye
> hello.goodbye
>
> --
> You received this message because you are subscribed to the Google Groups "jQuery Development" group.
> To post to this group, send email to [hidden email].
> To unsubscribe from this group, send email to [hidden email].
> For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.
>
>
>
>

--
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.