看到题主所说的数据自用 100k,感觉没必要上数据库,直接存 js 里或者 xml 里
想到自己一个实例
https://github.com/insoxin/API/blob/master/gy/index.html```
jQuery.getScript("
https://api.isoyu.com/gy/data.js", function () {
var max = jsondata.data.length;
var num = Math.round(Math.random() * max);
var picUrl = jsondata.data[num].child_pic;
var moreUrl = jsondata.data[num].url;
var more = ' <a href="' + moreUrl + '" target="_blank">详细情况</a>|<a href="
https://api.isoyu.com/" target="_blank">姬长信 API</a>';
var name = '<strong>' + jsondata.data[num].name + '</strong>';
var sex = '(' + jsondata.data[num].sex + ")" + ',';
var birthTime = '<br/><b>出生日期:</b>' + jsondata.data[num].birth_time + ',';
var lostTime = '<br/><b>失踪时间:</b>' + jsondata.data[num].lost_time + ',';
var lostPlace = '<br/><b>失踪地点:</b>' + jsondata.data[num].lost_place + ',';
var childFeature = '<br/><b>失踪人特征描述:</b>' + jsondata.data[num].child_feature;
$('h2').text("");
$('.api-isoyu-com').attr("src", picUrl);
$('p.text-muted').addClass('text-left').html(name + sex + birthTime + lostTime + lostPlace + childFeature + more);
});
function GetQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
if (GetQueryString('id') !== null) {
location.pathname = GetQueryString('id');
}
```
https://github.com/insoxin/API/blob/master/gy/data.js```
{"id":"#","name":"#","sex":"#","birth_time":"#","lost_time":"#","child_pic":"#","lost_place":"#","url":"#","child_feature":"#","ext2":"#","ext1":"#","city":"#","province":"#","expire":"#","api":"
https://api.isoyu.com/"},
```