wolegca.github.io/js/view.js
2022-09-24 22:32:41 +08:00

34 lines
861 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function () {
var index = window.parseInt(getQueryString('i'));
if (window.isNaN(index)) {
message.alert('发生错误', '缺少参数或参数类型不正确请检查URL是否正确', function () {
window.location.replace('/');
});
return;
}
$.ajax({
type: "GET",
url: "content.json?timestamp=" + (new Date()).valueOf(),
dataType: "json",
success: function (response) {
if (response.length <= index)
return;
listContent(response, index);
$.ajax({
type: "GET",
url: 'content/html/' + response[index]['date'] + '.html',
success: function (res) {
appendContent(res);
},
error: function () {
message.alert('出错了!', '网络连接出错了,请稍后再试');
}
});
},
error: function () {
message.alert('出错了!', '网络连接出错了,请稍后再试');
}
});
})();