I have code:
var availableSlots = "";
$.get( '', { availableSlots: userName }, function(a) {
availableSlots = a;
});
alert(availableSlots);
But alert outputs null, yes, when I put alert inside get, then everything works ok, but I need to use this value in another function. How can I do this?