<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<title>BitkkQcData</title>
</head>
<script type="text/javascript">
//动态刷新
setInterval("myInterval()", 4000);//1000为1秒钟
function myInterval() {
myfunction();
}
var markets = ["btc_qc","bcc_qc","ltc_qc","eth_qc","etc_qc","bts_qc",
"eos_qc","qtum_qc","hsr_qc","xrp_qc","dash_qc","ubtc_qc",
"bcd_qc","ink_qc","tv_qc","bcx_qc","bth_qc","lbtc_qc","chat_qc",
"hlc_qc","bcw_qc","btp_qc","bitcny_qc","topc_qc","ent_qc","bat_qc",
"safe_qc","qun_qc","btn_qc","true_qc","cdc_qc","ddm_qc",
"hotc_qc","xuc_qc","epc_qc","bds_qc","gram_qc","doge_qc","neo_qc","omg_qc","hpy_qc","btm_qc","snt_qc","ae_qc","icx_qc",
"zrx_qc","edo_qc","fun_qc","mana_qc","rcn_qc","xlm_qc","mco_qc","mith_qc","knc_qc","gnt_qc","mtl_qc","sub_qc","xem_qc","eosdac_qc","kan_qc","ada_qc"];
window.onload = myfunction;
function myfunction() {
//清空所有的子节点
$("#J_TbData").empty();
for (var i in markets){
var x =markets[i] ;
//console.log(x,i);
//市场名称分割
var xname_arr = x.split("_");
//alert(xname_arr[0]);
$.ajax({
type: "GET",
url: "http://api.bitkk.com/data/v1/ticker?market="+x,
cache: false,
async: false,
dataType: "json",
success: function (data, textStatus, jqXHR) {
var jsondata = JSON.stringify(data);
var orgnindata=data.ticker;
var $trTemp = $("<tr></tr>");
//往行里面追加 td单元格
$trTemp.append('<td><span class="label label-success">'+xname_arr[0]+'</span></td>'+
'<td><span class="label label-danger">'+orgnindata.high+'</span></td>'+
'<td><span class="label label-danger">'+orgnindata.low+'</span></td>'+
'<td><span class="label label-danger">'+orgnindata.last+'</span></td>'+
'<td><span class="label label-danger">'+orgnindata.vol+'</span></td>');
$trTemp.appendTo("#J_TbData");
}
})
};
};
</script>
<body class="table-responsive">
<div class="container">
<div class="row col-xs-6 col-md-9 col-lg-12 ">
<table class="table table-striped table-hover table-condensed ">
<thead>
<tr >
<th>币种</th>
<th>最高价</th>
<th>最低价</th>
<th>成交价</th>
<th>成交量</th>
</tr>
</thead>
<tbody id="J_TbData">
<tr >
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
所有市场名称分割获得行情
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 今天一大早,还没起床,朦朦胧胧就听见儿子在那叽里呱啦的说。 我昨天做了一个梦,和妈妈拿着我做那个彩虹,在我一个同学...