站长答疑:(张先生) | 手机:18616712339 | 在线QQ: | . |
|
钮门快递软件 >> 快递网站制作 jsHomePageInfo主页新闻数据处理
JavaScript脚本:
<script type="text/javascript"> function stInfo() { var niid;//记录ID,&nid= var curl;//如果为静态链接,链接串 var bstatic;//是否为静态链接:true:false var cpicture;//如果有图片,&pid= var ddate;//日期,YYYY.mm.dd HH:MM,自行处理 var ctitle;//标题 } function ellipTitle(str,n) { var ilen = str.length; if(ilen*2 <= n) return str; n -= 3; var i = 0; while(i < ilen && n > 0) { if(escape(str.charAt(i)).length>4) n--; n--; i++; } if( n > 0) return str; return str.substring(0,i)+"..."; } //--初始化信息空间及状态-- var nTotalFrame =4;//有多少组frame,数字需要改动!!! var anInfoGet = new Array(nTotalFrame);//新闻接收状态 var anTopicGet = new Array(nTotalFrame);//热点接收状态 for(i=0;i<nTotalFrame;i++) { anInfoGet[i] = -1; anTopicGet[i] = -1; } function FuncInfo(ic,n) { if(n > 0) anInfoGet[ic] = n; else anInfoGet[ic] = 0; if(anTopicGet[ic] >= 0) display(n,ic); } function FuncTopic(ic,n) { if(n > 0) anTopicGet[ic] = n; else anTopicGet[ic] = 0; if(anInfoGet[ic] >= 0) display(n,ic); } function display(n,ic) { var str=""; var o; var aID = new Array(); var bDup; var MaxNum = 7;//需要修改,最多显示几条 var TotalNum = 0; for(j=0;j<2;j++) { if(j == 0 && anTopicGet[ic] <= 0) continue; if(j == 1 && anInfoGet[ic] <= 0) continue; if(j == 0) //如果大于6组,需要改动!!! { if(ic == 0) o=otopic0; else if(ic == 1) o=otopic1; else if(ic == 2) o=otopic2; else if(ic == 3) o=otopic3; else if(ic == 4) o=otopic4; else o=otopic5; } else { if(ic == 0) o=oinfo0; else if(ic == 1) o=oinfo1; else if(ic == 2) o=oinfo2; else if(ic == 3) o=oinfo3; else if(ic == 4) o=oinfo4; else o=oinfo5; } for(i=0;i<o.length;i++) { bDup = false; for(x=0;x<aID.length;x++) { if(aID[x] == o[i].niid) { bDup = true; break; } } if(bDup) continue; aID[aID.length] = o[i].niid; if((++TotalNum) > MaxNum) break; str += "<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center' id='tbnews'>"; str += "<tr>"; str += "<td align='left' height='28'>"; str += "<a href='"; if(o[i].bstatic) str += o[i].curl; else { str += "http://www.sxyexpress.cn/cgi-bin/GInfo.dll?DispInfo&w=sxyexpress&nid="; str += o[i].niid; } str += "' target='_blank' class='"; if(j == 0) str += "fred'>"; else str += "newsList'>"; str += ellipTitle(o[i].ctitle,45); str += "</a></td>"; str += "<td align='left' width='62' class='newsListData'>["; str += o[i].ddate.substring(2,11); str += "]</td>"; str += "</tr></table>"; } } o = document.getElementById("news"+ic); if(o == null) return ; o.innerHTML=str; } </script> 在Java数据获取示例 <Script language=JavaScript type=text/javascript src=http://www.sxyexpress.cn/cgi-bin/GInfo.dll?jsHomePageInfo&w=sxyexpress&ckey=热点最新资讯&cvar=otopic0&cfunc=FuncTopic&inum=4&type=100&case=0></Script> <Script language=JavaScript type=text/javascript src=http://www.sxyexpress.cn/cgi-bin/GInfo.dll?jsHomePageInfo&w=sxyexpress&ckey=最新资讯&cvar=oinfo0&cfunc=FuncInfo&inum=7&type=20&case=0></Script> <Script language=JavaScript type=text/javascript src=http://www.sxyexpress.cn/cgi-bin/GInfo.dll?jsHomePageInfo&w=sxyexpress&ckey=热点政策法规&cvar=otopic1&cfunc=FuncTopic&inum=4&type=100&case=1></Script> <Script language=JavaScript type=text/javascript src=http://www.sxyexpress.cn/cgi-bin/GInfo.dll?jsHomePageInfo&w=sxyexpress&ckey=政策法规&cvar=oinfo1&cfunc=FuncInfo&inum=7&type=20&case=1></Script> <Script language=JavaScript type=text/javascript src=http://www.sxyexpress.cn/cgi-bin/GInfo.dll?jsHomePageInfo&w=sxyexpress&ckey=热点公司公告&cvar=otopic2&cfunc=FuncTopic&inum=4&type=100&case=2></Script> <Script language=JavaScript type=text/javascript src=http://www.sxyexpress.cn/cgi-bin/GInfo.dll?jsHomePageInfo&w=sxyexpress&ckey=公司公告&cvar=oinfo2&cfunc=FuncInfo&inum=7&type=20&case=2></Script> <Script language=JavaScript type=text/javascript src=http://www.sxyexpress.cn/cgi-bin/GInfo.dll?jsHomePageInfo&w=sxyexpress&ckey=热点物流信息&cvar=otopic3&cfunc=FuncTopic&inum=4&type=100&case=3></Script> <Script language=JavaScript type=text/javascript src=http://www.sxyexpress.cn/cgi-bin/GInfo.dll?jsHomePageInfo&w=sxyexpress&ckey=物流信息&cvar=oinfo3&cfunc=FuncInfo&inum=7&type=20&case=3></Script> 钮门快递软件|EMMIS[2022.11.11-22:28]编辑:钮门快递软件|EMMIS 访问:558
※※相关信息专题※※ §Ginfo手册
|
|
关于本网站
|
... |
物流查询工具
|
网站快速通道
|
其他服务与支持
|