Hi I am trying to pass a string into a namespace but have no idea of how to do this, there is a single ajax request that returns a string that I want to pass into the Clubs array
Can anyone explain in this example how I pass the var clubs into the clubs array below it?
$(function () { Website.init(); } );
$.ajax({
type : 'POST',
url : 'home/ajax_get_online_properties',
data: { },
success : function(data){
console.log(data);
var clubs = data;
},
error : function(XMLHttpRequest, textStatus, errorThrown) {
}
});
var Website = {
clubs: [
'Club 1',
'Club 2',
'Club 3'
]
}
See Felix answer above – seems the best method