数据接口
476
- Abbey2018-10-16论坛元老11769
- 本帖最后由 Abbey 于 2018-10-16 23:06 编辑 *

其实是告诉你两个数据接口,至于怎么用,就看你自己了
- $.ajax({
- url:'http://mlzb.pw',
- cache: false,
- type: "POST",
- dataType: "json",
- async: false,
- data: {'action': 'nav'},
- beforeSend:navbeforeSend, //发送请求
- success: function(data) {
- if(data.total>0){
- for(var i=0;i'+nav+''
- $("#subnav").append(html);
- }
- }
- $("#subnav").append(html);
- //加载主播
- LoadList();
- },
- complete:navcomplete//请求完成
- })
- - });
- - - function LoadList() {
- $.ajax({
- url:'http://mlzb.pw',
- cache: false,
- type: "POST",
- dataType: "json",
- data: {'action': 'get','plat':'JOJO'},
- beforeSend:listbeforeSend, //发送请求
- success: function(data) {
- console.log(data.total);
- if(data.total>0){
- for(var i=0;i';
- html+='
![]()
';- html+=''+room.name+'';
- html+='已直播:'+room.live_time+'';
- $("#live").append(html);
- }
- }
- },
- complete:listcomplete//请求完成
- });
- }
- - function listbeforeSend(XMLHttpRequest){
- $("#list").append("加载主播...");
- }
- - function navbeforeSend(XMLHttpRequest){
- $("#nav").append("加载平台...");
- }
- - function navcomplete(XMLHttpRequest, textStatus){
- $("#nav").remove();
- }
- - - function listcomplete(XMLHttpRequest, textStatus){
- $("#list").remove();
- }
- 复制代码