So, than just take a look waht happens if i comment the line  $(".menu li").unbind('click');   from example

See waht happens: http://127-creative.ru/tmp/jquery/site-jq.html


02.11.06 , Yehuda Katz <[EMAIL PROTECTED]> написал(а):
You don't need to unbind event handlers before reapplying them. jQuery tests whether an event handler is bound to an element before binding it. So you're not going to have doubling or tripling event handlers.

-- Yehuda

On 11/2/06, Марат < [EMAIL PROTECTED]> wrote:
Hi, there!

Is there more effective and beautiful way to reload all rules than that? Or a plugin, or something about that

$(document).ready(function(){
    $('.content').load('site.php?page=start');
    $(function() {
        var addClickHandlers = function() {   
            $(".menu li").click(function() {               
                $(".content").load('site.php',{page: $(this).attr('name')}, function(){
                    $(this).show("slow");       

//below goes discontent

                    $(".menu li").unbind('click');
                    addClickHandlers();
                });               
            });

//#loadeddata is returned by request clicking .menu li  (just looking if rules are reaplied)

            $("#loadeddata").click(function() {$(this).color('red');});           
        };
        addClickHandlers();
    });
});

I don't like this because I have to use callbacks all the time and to unbind events that are doubling, trippling and so on while returning new data and reaplying events

 $(".menu li").unbind('click');
 addClickHandlers();

--
____________________________

С уважением, Марат Мамяшев

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/





--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/





--
____________________________

С уважением, Марат Мамяшев
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to