Have an issue with scope in javascript and cant work out how to pass a value out
$(document).ready(function() {
availableTags = new Array();
$.getJSON('index.php?getTagList', function(data) {
availableTags = data;
alert(data);
});
alert(availableTags);
});
I know that the data is right and the alert confirms it but how do i assign it to the availableTags variable? seriousli strigling with scope in javascript...