[jQuery] $('#div').load('url') on ajax success?

[jQuery] $('#div').load('url') on ajax success?


Hi there,
Firstly this forum has been always been so good that's I've never actually
needed to start a thread before because the old threads are so useful!
<br />
Now though, i'm stuck!
<br /><br />
I have ajax which checks a login form<br />
on success I want to create a div and populate it with the contents of
another file<br />
<script>
$(function(){    
    $('#submit').click(function(){        
        var data_str = $('#login').serialize();                
        $.ajax({
         type: 'POST',
            async: false,
         url: 'frames/login/do_login_ajax.php', // Send the login info to this
page
         data: data_str,
         success: function(caught_frm_ajax){
                    if(caught_frm_ajax == 'SUCCESS')
                        {
                            $('.items').append('<div class="page" id="page2"></div>');                            
                            $('#page2').load('<?php echo $dd
?>st_pages/user/accounts/frames/user_main/index.php');
                            $('form#login').fadeOut();
                            $('#proceeder').fadeIn();                            
                            init_scroll();
                        }
                    else if(caught_frm_ajax == 'ERROR')
                        {
                            alert('username and password are smegd');
                        }
                 }
        }); //end ajax    
    return false;
    }); //end submit event
});
</script>
--
View this message in context: http://www.nabble.com/%24%28%27-div%27%29.load%28%27url%27%29-on-ajax-success--tp25783925s27240p25783925.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.