Все работает отлично, когда я использую такие статические данные:
Код: Выделить всё
var json = {
id: "whatever",
name: "start",
children: [{
"id": "0.9685",
"name": " contents:queue"
}, {
"id": "0.79281",
"name": " contents:mqq_error"
}
}]
}
Код: Выделить всё
var json = (function() {
var json = null;
$.ajax({
'async': false,
'global': false,
'url': "/content.json",
'dataType': "json",
'success': function(data) {
json = data;
}
});
return json;
})();
Что я пропустил?
Подробнее здесь: https://stackoverflow.com/questions/144 ... o-variable