home.js ausgebessert
This commit is contained in:
parent
013bdb4ce1
commit
eeaf7b428c
@ -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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user