问题描述
js画表格问题有哪位大哥好心,帮我详细解释一下下面这段代码,主要是位重数据库表里取数据然后用下面这段代码一一的画出表格显示到页面functionreload(){for(vara=0;a<bms.length;a++)for(varb=0;b<shsizes.length;b++){getBookmakerOdds(bms[a],shsizes[b]);}}functiondraw(){varsb=[];for(varkinsds.versus){if(!leagueData[sds.versus[k][0]])leagueData[sds.versus[k][0]]=sds.league[sds.versus[k][0]];alert(shsizes.length);alert(k);vari1=false;varosb=[];for(vara=0;a<siz;a++){varhome=away=hgd=ih=ia=id='';if(a<siz&&bmsts[k]&&bmsts[k][bms[a]]&&bmsts[k][bms[a]][curOddsType]){alert(shsizes.length);alert(home);varb=bmsts[k][bms[a]][curOddsType];home=b[3];away=b[4];hgd=curOddsType==1?def.vs.handicap[b[2]]||'':b[curOddsType==2?6:2];ih=b[6];id=b[5];ia=b[7];if(!i1)i1=true;}osb.push(tpl_oddsbody[curOddsType].format(k,bms[a],(a%2==0?'':'bg2')+(a<siz-1?'':'la-'),home,hgd,away,ih,id,ia,bms[a]==0?'title="'+bmsn[a]+'"':home==''?'':('onclick="oddsdialog(this,'+k+','+bms[a]+','+curOddsType+',''+bmsn[a]+'|'+sds.versus[k][2]+'VS'+sds.versus[k][4]+'')"onmouseover="mouseover(this)"onmouseout="mouseout(this)"style="cursor:pointer"title="'+bmsn[a]+'"'),home==''&&away==''&&hgd==''&&ih==''&&id==''&&ia==''?'style=display:none':'',odds.compareInit(home,ih),odds.compareInit(hgd,id),odds.compareInit(away,ia)));}if(!i1)continue;varb=sds.versus[k];varlid=b[0];varleague=sds.league[lid];varlcolor=league[5];if(lcolor=='')lcolor='#00ccff';varhome_rank=b[10];if(home_rank!='')home_rank='<spanclass=rank-s>['+b[10]+']</span>';varaway_rank=b[11];if(away_rank!='')away_rank='<spanclass=rank-s>['+b[11]+']</span>';sp=tpl_spoddsbody.format(k,b[9],b[6],b[7],b[8]);sb.push(tpl_body.format(k,lcolor,lid,league[1],b[5],b[1],b[2],b[3],b[4],osb.join(''),sp,'','',home_rank,away_rank));alert(home);deleteosb;}$('oddstable').innerHTML=tpl_header.format(bmsths.join(''))+sb.join('')+'</table>';for(vara=0;a<bms.length;a++){getBookmakerLive(bms[a]);}deletebmsts;//odds.leagueMenuInit();live();}
解决方案
解决方案二:
路过帮顶=============11月6日,论坛升级公告,积分已经做了调整!http://topic.csdn.net/u/20081107/11/b27dc75f-14b1-4594-9de3-5b18d9e36a11.html此次调整增加了两个新的可用分获取渠道:1:帖子被推荐(加精)后,帖主可以获得88分的可用分奖励;2:帖子结帖后会返还帖主50%的悬赏分,无满意结帖不返还分数;3:接下来会不断增加新的可用分获取途径,比如参与活动赠送等,请大家多关注;