JSON

gun.json文件代码:

{
"Gun_class":[
"栓动式狙击枪",
"射手步枪",
"突击步枪",
"冲锋枪"
],
"Bolt-on-sniper-rifle":[
{
"name":"AWM",
"box_magazine":"10",
"bullet":".300马格南步枪弹",
"caliber":"7.62mm",
"weight":"6.5kg (不含弹匣)"
},
{
"name":"M24",
"box_magazine":"5",
"bullet":"M118特种弹",
"caliber":"7.62mm",
"weight":"5.4kg(不带瞄准镜)"
},
{
"name":"Kar98",
"box_magazine":"5",
"bullet":"7.92×57mm步枪弹",
"caliber":"7.92mm",
"weight":"3.9kg (无弹药装填)"
}
],
"sniper-rifle":[
{
"name":"MINI14",
"box_magazine":"5,20,30",
"bullet":"M193式5.56×45,mm和SS109式5.56×45,mm枪弹",
"caliber":"5.56mm",
"weight":"全枪质量(不含弹匣)----2.9kg"
},
{
"name":"SKS",
"box_magazine":"10",
"bullet":" 7.62×39mm",
"caliber":"7.62mm",
"weight":"未知"
},
{
"name":"SLR",
"box_magazine":"30",
"bullet":"SS109式5.56×45,mm枪弹",
"caliber":"5.56mm",
"weight":"步兵型----4.325kg"
},
{
"name":"MK14",
"box_magazine":"20",
"bullet":"7.62mm",
"caliber":"7.62mm",
"weight":"5.1kg"
}
]

}
gun.js文件代码片段
var header = document.querySelector('header');
var section = document.querySelector('section');
var requestURL = 'https://raw.githubusercontent.com/wusifan19980908/cdu.edu/master/gun.json';
var request = new XMLHttpRequest();
request.open('GET', requestURL);
request.responseType = 'json';
request.send();
var Guns ;
request.onload = function () {
Guns = request.response;
setHeader();
setGuns();
}
转载自远端json代码:https://github.com/wusifan19980908/cdu.edu/blob/master/gun.json

转载于:https://www.cnblogs.com/JDS-6/p/10116710.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值