两个不同的文件夹,但是里面的文件名相同
比如说我现在200808/a.html这个文件上,我想跳到200809/a.html上.

解决方案 »

  1.   

    你把时间当成1个变量
    比如200808.html  ,200809.html
    select的ID是sel_id
    var abc=document.getElementId("sel_id").value;
    var url=abc+".html";
      

  2.   

    楼上正解,再加一个document.location.href="构造的URL";
      

  3.   

    可能我刚才没说清楚:查询其他月份:
           <select id="permonth" name="permonth">
           <option value="9" selected="selected">2008年9月</option>
           <option value="8">2008年8月</option>     
           </select>
            <input type="submit" name="submit" value="查询" onclick="calu()" />当前页面如果是../20080930/a1.html
    我选择2008年8月时,我想让它跳到../20080831/a1.html
      

  4.   

    在option后面加一个value,然后用js判断实现跳转就可以了吧
      

  5.   

    我alert出来地址了,地址是正确的。可跳转不了,报url不正确.我的html是aspx自动生成的。郁闷!
      

  6.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    </head><body>
    <script type="text/javascript">
    function $(id){
    return document.getElementById(id);
    }
    function calu(){
    var url = window.location.href;
    var month = $("permonth").options[$("permonth").selectedIndex].value;
    month = month.length < 2 ? "0" + month : month;
    url = url.replace(/(^.*\/20\d{2})(\d{2})(\d{2}\/.*.htm[l]$)/, "$1" + month + "$3");
    window.location.href = url;
    }
    </script><select id="permonth" name="permonth">
           <option value="9" selected="selected">2008年9月</option>
           <option value="8">2008年8月</option>     
           </select>
    <input type="submit" name="submit" value="查询" onclick="calu()" /></body>
    </html>