结合两个ajax功能?

ok i have this:

/******AJAX SUBPAGES ACADEMIES****/
coachesLinks.click(function (e) {
    e.preventDefault();
});
coachesLinks.click(function (e) {
            var $el = jQuery(this);
            var URL = $el.attr('href');
            var URL = URL + " .main";
    jQuery(contentTwo).show('slow').load(URL, function () {
        scrollToAnchor('content_two');
        ajaxloader('.academy_coaches_readmore');
        accordion();
        $('.main').css('overflow', 'visible');
        $(contentTwo).css('overflow', 'visible');
        jQuery('#content_two .back').on('click', function () {
            jQuery(this).hide('slow');
            if (contentTwo.is(':hidden')) {
                jQuery('#content_two .back').hide();
            } else {
                contentTwo.hide('slow');
                jQuery(contentmain).show('slow');
                jQuery(contentmain).css('overflow', 'visible');
                scrollToAnchor('access');
            }
        });

    });
    $(contentmain).hide('slow');
});

and this:

function ajaxloader(myselector) {
        internalLinks = jQuery(myselector);
        internalLinks.click(function (e) {
            e.preventDefault();
        });
        internalLinks.click(function (e) {
            var $el = jQuery(this);
            var URL = $el.attr('href');
            var URL = URL + " .main";
            jQuery(contentTwo).show('slow').load(URL, function () {
                scrollToAnchor('content_two');
                $('.main').css('overflow', 'visible');
                $(contentTwo).css('overflow', 'visible');
                jQuery('#content_two .back').on('click', function () {
                    jQuery(this).hide('slow');

                    if (contentTwo.is(':hidden')) {
                        jQuery(contenttwoback).hide();
                    } else {
                        contentTwo.hide('slow');
                        jQuery(contentmain).show('slow');
                        jQuery(contentmain).css('overflow', 'visible').delay(100);
                        scrollToAnchor('access');

                    }
                });

            });
            $(contenttwoback).show('slow');
            $(contentmain).hide('slow');
        });
}

with these variables:

/******variables******************/
            var contentmain = jQuery('#content > .main');
            var contentTwo = jQuery('#content_two');
            var siteURL = 'http://' + top.location.host.toString();
            var coachesLinks = jQuery(' .academy_readmore');

I'm calling the second function like so:

/******AJAX SUBPAGES SUBMENU FUNCTION****/
ajaxloader('#submenunav ul li a');
/******AJAX SUBPAGES COACHES****/
ajaxloader('#accordion .coaches_readmore');
/******AJAX LESSONS***/
ajaxloader('#accordion .lessons_readmore');

Which works perfectly my question is how do i call the second function with the nested ajax as a parameter? something like this (which doesn't work):

 ajaxloader('#accordion .lessons_readmore' ajaxloader('.academy_coaches_readmore'));

Nesting the second ajax load inside of the first ajax loader?? Chris full copy of the code here: http://jsfiddle.net/JGVEb/

Do you mean that you want these AJAX requests to be performed in serial, such that the second one happens only after the first one completes?

You can supply a callback function as a parameter in your function. Something like this:

function ajaxloader(myselector, callback) {
    // some code
    jQuery(contentTwo).show('slow').load(URL, function () {
        // more code

        if (callback) { callback(); }
    });
};

That way it will invoke the callback after it's finished with the AJAX request. You'd then invoke it like any other jQuery function that has a callback:

ajaxloader('#accordion .lessons_readmore', function () {
    ajaxloader('.academy_coaches_readmore'));
});