wolegca.github.io/js/index.js

38 lines
817 B
JavaScript
Raw Normal View History

2019-09-20 12:31:47 +08:00
// $.ajax({
// type:"GET",
// url:"https://javacloud.bmob.cn/0104a7ae840e3555/counter?name=wcx",
// async:true,
// success:function(res){
// message.alert('提示',res);
// },
// error:function(){
// message.alert('提示','error!');
// }
// });
2019-09-20 22:34:39 +08:00
var index = getQueryString('i');
2019-09-20 12:31:47 +08:00
$.ajax({
type: "GET",
2019-09-20 22:34:39 +08:00
url: "content.json?timestamp=" + (new Date()).valueOf(),
2019-09-20 12:31:47 +08:00
dataType: "json",
success: function (response) {
var lastIndex = response.length - 1;
2019-09-20 22:34:39 +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, lastIndex);
2019-09-20 12:31:47 +08:00
2019-09-20 13:32:44 +08:00
if (response[lastIndex]['hasCode'])
2019-09-20 12:31:47 +08:00
loadScript('content/js/' + response[lastIndex]['date'] + '.js');
$.ajax({
type: "GET",
url: 'content/html/' + response[lastIndex]['date'] + '.html',
2019-09-20 13:32:44 +08:00
success: function (res) {
appendContent(res);
2019-09-20 12:31:47 +08:00
}
});
}
});