I'm trying to get a variable (lib) out of a multiple nested functions.
var nme='name',lib;
$('script').each(function(){
    var src=$(this).attr('src');
    if(typeof(src)==='undefined'){src='';}
if(src.indexOf(nme)!==-1){
    $.get($(this).attr('src').match(/\w([^ ]+)spbin/)[0]+'/conf/ptmedia.plist',
        function(c){
            $(c).find('key').each(function(){
                if($(this).html()==='MediaLib'){lib=$(this).next().html();}
            });
        }
    );
}
});
if(lib==='some lib'){DO STUFF}
 
    