Currently you're logging the
iconaddy variable which will always return
null, instead what you want to be doing is logging the data parameter been set in your anonymous function for
success. To set the variable you can simply assign the value of
data to the
iconaddy variable, you will have to make one small change when doing that though which is to add the async setting in your ajax request and set the value to false which will make the request synchronous which means the code following the ajax request will only get triggered upon the request been completed first.
See the below example if that didn't make sense.
Code JavaScript:
var myVariable = '';
$.ajax({
async : false,
success : function(data) {[ATTACH=CONFIG]61177[/ATTACH]
myVariable = data;
}
});
Bookmarks