Jquery load script rather than call inline function
I'm not too great with jquery and maybe this title doesn't explain too well what i want to do but here goes:

    $.ajax({
    url : 'my_action',
    dataType: 'script',
    beforeSend : function(){   //can i not just call a script here instead?
        if(1 == 1) //just an example
        {
            return false
        }
    },
    complete: function(){
        console.log('DONE');
    }
    });

So in beforeSend, i want to call a script rather than have an inline function.  This is because my function is quite long and it makes the ajax code i have look messy.

Is that possible?

Thanks,    
Jquery load script rather than call inline function
===

I'm not too great with jquery and maybe this title doesn't explain too well what i want to do but here goes:

    $.ajax({
    url : 'my_action',
    dataType: 'script',
    beforeSend : function(){   //can i not just call a script here instead?
        if(1 == 1) //just an example
        {
            return false
        }
    },
    complete: function(){
        console.log('DONE');
    }
    });

So in beforeSend, i want to call a script rather than have an inline function.  This is because my function is quite long and it makes the ajax code i have look messy.

Is that possible?

Thanks,    