I'm going to go out on a limb and say there is very little difference
between them.

I suppose it is possible that the second function has a little bit more
overhead, because it is declaring a jQuery element, then finding a second
element.  The first example doesn't do that.

But both of these methods end up at the same place internally:

.bind("click", function() {})
.click(function() {})

becomes:

jQuery.event.add(element,type,handler,data)

JK

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Shelane Enos
Sent: Tuesday, April 17, 2007 9:50 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] find.click vs bind("click")


What is the difference, advantage/disadvantage of these different methods:

bindEdit = function(){
$j('#edit').bind("click", function(){
            var linkval = $(this).attr("href");
            $j('#jobinfo').load(linkval, function(){
                bindEdit();
            });
            return false;
        });
}

bindEdit = function(){
$j('#jobinfo').find('#edit').click(function(){
            var linkval = $(this).attr("href");
            $j('#jobinfo').load(linkval, function(){
                bindEdit();
            });
            return false;
        });
}


Reply via email to