Stuck, is it possible to take a value from an ajax call in one .js file and use it another .js file?

Stuck, is it possible to take a value from an ajax call in one .js file and use it another .js file?

In other words I want to take the value from a variable within an ajax call in one .js file and make it keep it's same value to be used in a different .js file?

Still learning jquery and javascript after having learned java. To me this seems like it would be so easy yet is impossible to implement, for me at least :-(

I have a main.js file that uses a global variable citId (I know globals are bad but I don't know a good way around using it and I can't get it to work anyway)

var citId = "";
$(document).ready(function($) {
    // First link out of three
    var url = 'https://www.sciencebase.gov/catalog/items?parentId=504108e5e4b07a90c5ec62d4&max=60&offset=0&format=jsonp';
    $.ajax({
        type: 'GET',
        url: url,
        jsonpCallback: 'getSBJSON',
        contentType: "application/json",
        dataType: 'jsonp',
        success: function(json) {
                     var linkBase = "http://www.sciencebase.gov/catalog/item/";
                     var link = "";                    
                     var itemId = "";                   
                     var urlId ="";                                         

                     $.each(json.items, function(i,item) {
                         link = linkBase + this.id;

                         $('#sbItems').append('<li><b><a href="' + link + '" id="idNum' + i + ' ">' + this.title + '</a> - </b>' + this.summary + '</li>');                    
                     });                    
                       $('#sbItems a').on('click', function (e) {
                                 e.preventDefault();                        
                                 var str = $(this).attr('id');                        
                                 if (str.length == 7) {                     
                           itemId = str.slice(5,6);
                         } else if (str.length == 8) {
                             itemId = str.slice(5,7);
                         }
                       urlId = json.items[itemId].id;

                         $.ajax({
                              type: 'GET',
                              url: 'https://www.sciencebase.gov/catalog/itemLink/' + urlId + '?format=jsonp',
                              jsonpCallback: 'getSBJSON',
                              contentType: "application/json",
                              dataType: 'jsonp',
                              success: function(json) {

                                                if (json.length > 0) {
                                                    citId = urlId; 
                                                    alert(citId);
                                                    window.open('Citations.html', '_self');
                                                }
                                                else {
                                                    var page = linkBase + urlId;
                                                    window.open(page);
                                                }

                              },
                              error: function(e) {
                                  console.log(e.message);
                              }  
                         });         
                     });
        },
        error: function(e) {
            console.log(e.message);
        }
    });
});

and I have a citations.js file that would take the citId and simply plug into a url. The problem is getting the value of the variable into my other file somehow??

I've tried a bunch of things, the latest being using the complete param of the ajax call in my main.js and making a function that would store the variable value after the ajax call completed, however it seems that the value is fine as long as I use it inside main.js, but outside of the file it just returns back to the original global variable value.

Is there some way to make it keep it's value from file to file?

Any help is appreciated!