新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> XML网站展示,XML源代码,XML编程示例。 本版仅接受原创、转贴、网站展示,具体的技术交流请前往各相关版块。
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - XML技术『 XML源码及示例(仅原创和转载) 』 → 有获取远程xml文件,但不懂如何移植过来,请超级大虾解决。 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 2185 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: 有获取远程xml文件,但不懂如何移植过来,请超级大虾解决。 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     yangbobo 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:3
      积分:64
      门派:XML.ORG.CN
      注册:2004/10/14

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给yangbobo发送一个短消息 把yangbobo加入好友 查看yangbobo的个人资料 搜索yangbobo在『 XML源码及示例(仅原创和转载) 』的所有贴子 引用回复这个贴子 回复这个贴子 查看yangbobo的博客楼主
    发贴心情 有获取远程xml文件,但不懂如何移植过来,请超级大虾解决。

    我想获取 http://www.18638.com/Data.xml数据,但下列文件在本机运行可以获得本机的data.xml文件,就是不能获得远程data.xml文件。
         请哪位大虾帮帮忙,把下来的文件改成可以获得远程数据的文件,我在这里谢谢各位了!!!!!!
        我看了这篇文章,做成功了。但不知如何移植过来。供参考。http://www.wrclub.net/study/listarticle.aspx?id=2682

    <script language="javascript">
    document.write("<XML ID=\"xmldso\"></XML>");
    var oldmacauslot,trcolor,macauslotcol,omcount="";
    var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    var oddchangeA="&nbsp;<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='10' HEIGHT='10'><PARAM NAME=movie VALUE='swf/odds_changeA.swf'><param name='scale' value='ExactFit'><param name='Menu' value='false'><param name='wmode' value='transparent'></OBJECT>";
    var oddchangeB="&nbsp;<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='10' HEIGHT='10'><PARAM NAME=movie VALUE='swf/odds_changeB.swf'><param name='scale' value='ExactFit'><param name='Menu' value='false'><param name='wmode' value='transparent'></OBJECT>";
    var showoddsDN="&nbsp;<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' WIDTH='10' HEIGHT='10'><PARAM NAME=movie VALUE='swf/odds_changeC.swf'><param name='scale' value='ExactFit'><param name='Menu' value='false'><param name='wmode' value='transparent'></OBJECT>";
    var loadData=0;
    function readXMLfirst(){xmlDoc.load("Data.xml");xmlDoc.onreadystatechange=showoddsfirst;if(loadData==0){window.setTimeout("readXMLfirst()",2000);}else{readXML();}}

    function showoddsfirst(){
    if (xmlDoc.readyState!=4){return;}
    try{
    xmldso.XMLDocument.async="false";
    xmldso.XMLDocument.loadXML(xmlDoc.xml);
    var rootElement=xmlDoc.documentElement;
    var macauslot=rootElement.childNodes[1];

    macauslotcol=macauslot.childNodes.length;
    macauslotrow=macauslot.childNodes[0].attributes.length;
    maintxt="";
    trcount="";


    for(i=0;i<macauslotcol;i++){
            if(trcount==1){trcolor=" bgcolor=white";trcount="";}else{trcolor=" bgcolor=#EEEEEE";trcount=1;};

     macauslotbet=macauslot.childNodes[i];
     matchSS=macauslotbet.attributes[2].nodeValue.replace("\"","").replace("\"","");
     team_nameAA=macauslotbet.attributes[3].nodeValue.split("*"); 
     matchColor=macauslotbet.attributes[9].nodeValue;
     matchID=macauslotbet.attributes[0].nodeValue;
     indexID=macauslotbet.attributes[8].nodeValue;


        team_nameA=macauslotbet.attributes[3].nodeValue.replace("*","(主)");
        team_nameB=macauslotbet.attributes[4].nodeValue.replace("*","(主)");
        team_oddsA=macauslotbet.attributes[6].nodeValue;
        team_oddsB=macauslotbet.attributes[7].nodeValue;
        team_oddsTDA="id='OMODDSA_"+matchID+"'";
        team_oddsTDB="id='OMODDSB_"+matchID+"'";


     graphicsname=macauslotbet.attributes[3].nodeValue.replace("*","");
     maintxt=maintxt+"<tr height=40 "+trcolor+">";
     maintxt=maintxt+"<td class='T2' style='color:white;background-color:"+matchColor+";'>"+matchSS.substr(0,10)+"<br>"+macauslotbet.attributes[1].nodeValue+"<span id='CHANGE_"+matchID+"'></span>";
     maintxt=maintxt+"<td class='T2'>"+team_nameA+"<br><span class='ODDS' "+team_oddsTDA+">"+team_oddsA+"</span><span id='OMGBA_"+matchID+"'></span>";
     maintxt=maintxt+"<td class='T2'><span id='macthODDS_"+matchID+"'>"+macauslotbet.attributes[5].nodeValue+"</span><br><a href=\"graphics.htm?id="+indexID+",itemname='"+graphicsname+"'\"  target='zqzz_oddsgraphics'>走势图</a>";
     maintxt=maintxt+"<td class='T2'>"+team_nameB+"<br><span class='ODDS' "+team_oddsTDB+">"+team_oddsB+"</span><span id='OMGBB_"+matchID+"'></span></tr>";
          }

    content.innerHTML="<table border=1 class='T1' cellspacing=0 cellpadding=0 bordercolor='#DDDDDD'><tr style='text-align:center;color:#FFFFFF;background-color:#CC0000' height=25><td width=110>开赛时间<td width=130><td width=75>让球(左让右)<td width=130></tr>"+maintxt+"</table>";
    if(omcount != macauslotcol){omcount=macauslotcol;loadData=1;}
    }catch(a){}

    }

    readXMLfirst();


    function converColor(cc){
    color="green";
    for(k=0;k<=match_type.length;k++){  
        if(match_type[k]==cc){color=matchcolor[k];break;}
        }
    return color;
       }


    function readXML(){
    xmlDoc.load("Data.xml");
    xmlDoc.onreadystatechange=showodds;
    window.setTimeout("readXML()",4000);}

    function showodds(){
    if (xmlDoc.readyState!=4){return;}
    try{
    xmldso.XMLDocument.async="false";
    xmldso.XMLDocument.loadXML(xmlDoc.xml);
    if(xmlDoc.xml==""){return;}
    if(oldmacauslot==xmlDoc.xml){return;}
    rootElement=xmlDoc.documentElement;
    macauslot=rootElement.childNodes[1];

    macauslotcol=macauslot.childNodes.length;
    if(omcount != macauslotcol){showoddsfirst();}
    macauslotrow=macauslot.childNodes[0].attributes.length;

    for(i=0;i<macauslotcol;i++){
    d = new Date();
    macauslotbet=macauslot.childNodes[i];
    id_om=macauslotbet.attributes[0].nodeValue;

    if(document.all["OMODDSA_"+id_om].innerText != macauslotbet.attributes[6].nodeValue)
     {
     if(showgoal_s.checked){showoddsUP=oddchangeB;}else{showoddsUP=oddchangeA;}

     team_nameAA=macauslotbet.attributes[3].nodeValue.split("*"); 
     
        team_nameA=macauslotbet.attributes[3].nodeValue.replace("\"","").replace("*","")+"(主)";
        team_nameB=macauslotbet.attributes[4].nodeValue.replace("\"","").replace("\"","").replace("*","");
        team_oddsA=macauslotbet.attributes[6].nodeValue;
        team_oddsB=macauslotbet.attributes[7].nodeValue;
        old_oddsA=document.all["OMODDSA_"+id_om].innerText;
        old_oddsB=document.all["OMODDSB_"+id_om].innerText;

    if(document.all["macthODDS_"+id_om].innerText != macauslotbet.attributes[5].nodeValue){document.all["macthODDS_"+id_om].innerText=macauslotbet.attributes[5].nodeValue;}

     document.all["CHANGE_"+id_om].innerHTML="<img src='images/new.gif' border=0 align='absMiddle' height=10>";

     if(document.all["OMODDSA_"+id_om].innerText < macauslotbet.attributes[6].nodeValue)
     {
     if(team_nameAA.length>1){omgb_A=showoddsUP;omgb_B=showoddsDN;}else{omgb_B=showoddsUP;omgb_A=showoddsDN;}
     document.all["OMODDSA_"+id_om].style.color="red";
     document.all["OMODDSB_"+id_om].style.color="green";
     }else{
     if(team_nameAA.length>1){omgb_B=showoddsUP;omgb_A=showoddsDN;}else{omgb_A=showoddsUP;omgb_B=showoddsDN;}
     document.all["OMODDSA_"+id_om].style.color="green";
     document.all["OMODDSB_"+id_om].style.color="red";
     }

        document.all["OMGBA_"+id_om].innerHTML=omgb_A;
        document.all["OMGBB_"+id_om].innerHTML=omgb_B;
        document.all["OMODDSA_"+id_om].innerText=macauslotbet.attributes[6].nodeValue;
        document.all["OMODDSB_"+id_om].innerText=macauslotbet.attributes[7].nodeValue;


    window.setTimeout("showTheText("+id_om+")",60000);

    showchangetext("<table border=1 width='100%' class='T1' style='line-height:24 px;' cellpadding=2 bgcolor=white  bordercolor='#DDDDDD'><tr><td width='39%' class='T2'>"+team_nameA+"<td width='22%' class='T2'>【澳门】<td width='39%' class='T2'>"+team_nameB+"<tr><td class='T2'>"+old_oddsA+" → "+team_oddsA+omgb_A+"<td class='T2'>"+macauslotbet.attributes[5].nodeValue+"<td class='T2'>"+old_oddsB+" → "+team_oddsB+omgb_B+"</table>");
     }
    }
    }catch(b){}
    oldmacauslot=xmlDoc.xml;
    }


    function showTheText(textid){
      document.all["OMODDSA_"+textid].style.color="";
      document.all["OMODDSB_"+textid].style.color="";
      document.all["CHANGE_"+textid].innerText=document.all["OMGBA_"+textid].innerText=document.all["OMGBB_"+textid].innerText="";
        }


    function showchangetext(MM)
      {
     document.all.zqzz_showgoaltext.insertAdjacentHTML("afterEnd",MM);
      }
    </script>


       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2004/10/14 23:31:00
     
     风城浪子 帅哥哟,离线,有人找我吗?
      
      
      等级:大一(猛啃高等数学)
      文章:12
      积分:111
      门派:XML.ORG.CN
      注册:2004/10/13

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给风城浪子发送一个短消息 把风城浪子加入好友 查看风城浪子的个人资料 搜索风城浪子在『 XML源码及示例(仅原创和转载) 』的所有贴子 引用回复这个贴子 回复这个贴子 查看风城浪子的博客2
    发贴心情 
    我也想知道!

    ----------------------------------------------
    我的Blog:http://blog.csdn.net/amomi HomePage:http://www.new57.com

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2004/10/15 20:38:00
     
     yangbobo 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:3
      积分:64
      门派:XML.ORG.CN
      注册:2004/10/14

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给yangbobo发送一个短消息 把yangbobo加入好友 查看yangbobo的个人资料 搜索yangbobo在『 XML源码及示例(仅原创和转载) 』的所有贴子 引用回复这个贴子 回复这个贴子 查看yangbobo的博客3
    发贴心情 
    没人告诉俺们....................
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2004/10/20 22:52:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 XML源码及示例(仅原创和转载) 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2025/1/20 13:57:23

    本主题贴数3,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    93.750ms