home.js ausgebessert

This commit is contained in:
Edwina Barbalan 2018-12-28 10:18:21 +01:00
parent 013bdb4ce1
commit eeaf7b428c

View File

@ -29,3 +29,29 @@ const HomeRouter = {
this.refresh_messages(); this.refresh_messages();
}*/ }*/
}; };
function get_insert_message(id) {
$.get(id + ".json").done(function (msg) {
// _messages[id] = msg;
Vue.set(_messages, id, msg);
}).fail(function (e, f, g) {
console.log("cannot load " + id + ".json: " + e + f + g);
})
}
$(document).ready(function () {
console.log("egal");
$.get('list.json').done(function (jd) {
// _messagelist = jd;
_messagelist.splice(0, _messagelist.length);
_messagelist.push.apply(_messagelist, jd);
console.log("egal2");
//$('#xxx').text(jd[0]);
for (var e in jd) {
if (!_messages[jd[e]]) {
get_insert_message(jd[e]);
}
}
}).fail(function (e, f, g) {
console.log("egal3: " + e + f + g);
});
});