var desc;
    $.ajax({
        url: "data/step2.xml",
        dataType: "xml",
        success: function(data){
            $(data).find('date').each(function(){
                var day = $(this).find('day').text();
                var date = $("#txtDate").datepicker("getDate");
                date = (date.getDate()+"-"+date.getMonth()+1+"-"+date.getFullYear());
                if (day==date){
                    $(this).find('availability').each(function(){
                        var prod = $(this).find('product').text();
                        var time = $(this).find('starttime').text();
                        if (prod==label){
                            desc="!";
                        }
                    });
                }
            });
        }
    });
I'm having some issues accessing the desc variable... I want to manipulate it's value as you can see in desc="!", but it returns undefined. Isn't there any way to make the variable global or something? or some other way to access it? ...
Oh, and all this code is inside a function.
 
     
    