I am making an ajax request and storing the response as a variable as you can see bellow. My problem is that I need to make sure response is complete and the variable is set before continuing on. I believe this is an issue with async but am unsure as how to correct such an issue. Going off of other posts i adjusted the code bellow to use the $.ajax notation and set async to false however still had issues with the script moving on before var a was set thus i was working with an undefined variable else where. Including a success script and/or callback didn't improve results either.
var a = [];
$(window).load(function () {
$.get('################', function (response) {
a.resp = response;
});
});