我问的不是这个好不?我是说div里的内容根据这个时间的不同而读取不同的数据

解决方案 »

  1.   

    我问的不是这个好不?我是说div里的内容根据这个时间的不同而读取不同的数据那就根据时间按天或者按月判断所需要取的数据就行了
      

  2.   

    我问的不是这个好不?我是说div里的内容根据这个时间的不同而读取不同的数据那就根据时间按天或者按月判断所需要取的数据就行了我知道啊!可是怎样做咯
    《html》 <!--time begin-->
                <section class="c-time">
                <script>
                  document.writeln("<div class=\"showtime\"><div id=\"tew\" style=\"display:none;\">"+GetDateStr(0)+"</div><div id=\"livetime\" style=\"display:none;\">"+GetDateStr3(0)+"</div><div id=\"nowtime\" >"+GetDateStr2(0)+"</div></div>");
    </script>《!---时间--》
                <!--button-->
                
                <div class="prev-time" id="prev-timet"><img src="images/history_back.png"></div>
                <div class="next-time" id="next-timet"><img src="images/history_back2.png"></div>
                <!--button end--> 
                 
                </section>
               <!--time end-->
    <section class="demo arc"> 
            <!-- Lable 1 -->
            <div class="pre_cont_div" id="pre">
    <script src="js/soccer/soccer_odds2.js"></script> 《!---要 显示的内容--》
            </div>
    </section>
    js/soccer/soccer_odds2.js---
    var country = decodeURI(decodeURI(mc));if (window.ActiveXObject) {
       oXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
       oXmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");
       oXmlHttp2 = new ActiveXObject("Microsoft.XMLHTTP");
       oXmlHttp5 = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else
    if (window.XMLHttpRequest) {
        oXmlHttp = new XMLHttpRequest();
    oXmlHttp1 = new XMLHttpRequest();
        oXmlHttp2 = new XMLHttpRequest();
    oXmlHttp5 = new XMLHttpRequest();
    }
    function CreateXMLroot() 

    oXmlHttp1.open( "GET", "xml/odds_config.xml", false ) ; 
    oXmlHttp1.send(null) ; 
    oddsrootnode = oXmlHttp1.responseXML.documentElement; oXmlHttp2.open( "GET", "xml/odds.xml", false ) ; 
    oXmlHttp2.send(null) ; 
    oddsrootnode2 = oXmlHttp2.responseXML.documentElement;oXmlHttp5.open( "GET", "xml/predictions.xml", false ) ; 
    oXmlHttp5.send(null) ; 
    oddsrootnode5 = oXmlHttp5.responseXML.documentElement;} 
    CreateXMLroot()   var nowtimetry=document.getElementById('tew').innerHTML.toString();            var datas = new Array();                             //存储实体的数组          
                if(oddsrootnode)
                {
                        var nodes;


       
    if(country.length!=0){
     var nodes = oddsrootnode.selectNodes("//Fixtures/Fixture[@tt='"+country+"' and @s="+2+" and (contains(@gt,'" + nowtimetry+ "'))]");
     
     if(nodes.length==0){ alert("对不起!该赛事没有任何信息!");window.location.href="odds-test.html";}
    }
    else{
       
                           var nodes = oddsrootnode.selectNodes("//Fixtures/Fixture[(@s=2) and (contains(@gt,'" + nowtimetry+ "'))]");//
    }

    for(var it=0;it<nodes.length;it++)
    {
     
    var node_id=nodes[it].attributes["id"].value;//ID
    var date=nodes[it].attributes["gt"].value;
    var dateymd=date.substring(0,8);
    var datetime=date.substring(9,14);

    //賽事全稱
      

  3.   

    读取xml里的数据选取的时间不同,数据也就不同时间变化已经做好了,可是怎样才能让数据也跟着变化啊
      

  4.   

    你从这个DIV获取时间后,到数据源中获取新的数据然后将展示数据的控件重新绑定即可
      

  5.   

    就是这一步不知道怎样做啊而且我用这个获取这个时间var nowtimetry=document.getElementById('tew').innerHTML.toString();如果我点击按钮--时间变化了,但是这个var nowtimetry=document.getElementById('tew').innerHTML.toString();还是默认的当天时间
      

  6.   

    这个你要看看tew是服务端控件还是客户端控件,另外你的按钮也要看下是服务端控件还是客户端控件,最好都统一为客户端控件,否则会向服务器回传
      

  7.   

    晕啊!请问怎样可以获得这个变化的时间
    function time() {

    var prevtime= document.getElementById('prev-timet');
    var nexttime=document.getElementById('next-timet');   
    prevtime.onclick=function(){

    var nowtimey=document.getElementById('tew').innerHTML.toString();

            var time8=GetDateStr(0);

    var timetimel=[parseInt(nowtimey,10)-1];

        var timelength=time8-timetimel;

    if(timelength<7){

    document.getElementById('tew').innerHTML=timetimel;

    var i=-timelength;

    var timetime2=GetDateStr2(i);
    document.getElementById('nowtime').innerHTML=timetime2;

    var timetime3=GetDateStr3(i);
    document.getElementById('livetime').innerHTML=timetime3;       }
      

    };
    nexttime.onclick=function(){
    var nowtimey=document.getElementById('tew').innerHTML.toString();        var time8=GetDateStr(0);

    var timetimel=[parseInt(nowtimey,10)+1];

        var timelength=timetimel-time8;

    if(timelength<7){

    document.getElementById('tew').innerHTML=timetimel;

    var i=timelength;

    var timetime2=GetDateStr2(i); 
    document.getElementById('nowtime').innerHTML=timetime2;

    var timetime3=GetDateStr3(i);
    document.getElementById('livetime').innerHTML=timetime3;

    }
    };
    };我是这样写的--直接改变div的值--可是我要获得这个div每次变化的值来做判断。。怎样做啊
      

  8.   

    汗,你这样肯定不行啊,怎么能在一个变量上去绑定事件呢。$(function(){
        $(‘#prev-timet’).click(function(){
            //写你的业务逻辑
         })
    })控件事件的绑定一定要放在页面初始化函数中,直接在控件上绑定事件,而不要把控件赋给一个变量再绑定事件