wolegca.github.io/js/view.js

31 lines
752 B
JavaScript
Raw Normal View History

2019-09-20 13:32:44 +08:00
(function () {
var index = getQueryString('i');
$.ajax({
type: "GET",
2019-09-20 22:34:39 +08:00
url: "content.json?timestamp=" + (new Date()).valueOf(),
2019-09-20 13:32:44 +08:00
dataType: "json",
success: function (response) {
2019-10-19 21:56:07 +08:00
2019-09-21 16:07:59 +08:00
if (response.length <= index)
return;
2019-09-20 22:34:39 +08:00
listContent(response, index);
2019-09-20 13:32:44 +08:00
if (response[index]['hasCode'])
loadScript('content/js/' + response[index]['date'] + '.js');
$.ajax({
type: "GET",
url: 'content/html/' + response[index]['date'] + '.html',
success: function (res) {
appendContent(res);
2019-09-21 16:17:12 +08:00
},
2019-10-19 21:56:07 +08:00
error: function () {
message.alert('出错了!', '网络连接出错了,请稍后再试');
2019-09-20 13:32:44 +08:00
}
});
2019-09-21 16:17:12 +08:00
},
2019-10-19 21:56:07 +08:00
error: function () {
message.alert('出错了!', '网络连接出错了,请稍后再试');
2019-09-20 13:32:44 +08:00
}
});
})();