Javascript/jQuery, if and else statements both being executed
<p>I'm not too sure what's going on here and feel I may be missing something that is probably quite obvious, but I have an if else in which both statements are being called. If someone could shed some light on this that would be great. The code below is using asual and should be detecting whether or not a div  <code>$('#' + $.address.hash()</code> has already been loaded. However both if and else events are being fired in order. In fact the else statement fires twice...</p>

<pre><code>$('#lmit_back').show(400, function() {
    if($('#' + $.address.hash() ).length == 0) {
        $('#init').load('inithandler.php', { 'address' : $.address.hash() }, function() {
            $('#' + $.address.hash()).fadeIn(1000, function() {
                $('#remn').load('pagehandler.php',{ 'address' : $.address.hash() });
            });
        });
    }  
    else {
        alert('hey');
    }
});
</code></pre>

<p>Here is all the code..I can't really work out what could cause it to execute twice, unless it has something to do with address.change which im not as familiar with as I would like to be.</p>

<p>if (($.address.hash() == '')) {$.address.hash('home');}</p>

<pre><code>    $('#lmit_back').click(function() {

            $.address.hash('home');

    });


    $.address.change( function() {  



        if (!($.address.hash() == 'home')) 
        {



        var exception = '.' + $('[href="#' + $.address.hash() + '"]').parent().attr('class');


            $('#left_menu_bar li:not(' + exception + ')').hide(300,function() {

                $(exception).show( function() {

                    $('#left_menu_bar').animate({ width:'100%'},400, function() { 

                        $('#lmit_back').show(400, function() {


                                if ($('#' + $.address.hash() ).length === 0)
                                {

                                    $('#init').load('inithandler.php', { 'address' : $.address.hash() } , function() { 

                                        $('#' + $.address.hash()).fadeIn(1000, function() {

                                            $('#remn').load('pagehandler.php',{ 'address' : $.address.hash() });

                                        });



                                    });

                                }
                                else
                                {

                                alert('nigs');

                                }

                        });

                    });

                });

            });



        }
        else
        {




            $('#left_menu_bar').animate({ width:'251px'}, function() { 

                $('#left_menu_bar li').show( function() {

                    $('#lmit_back').hide();

                });

            });



            $('#left_menu_bar').css('width','251px');



        }


    }); 
</code></pre>
