<script   language   =   "JavaScript"> 
          for   (i=0;i   <   10;   i++) 
                { 
                        if   (i> 4   &&   i   <   6)
                        {   
                                alert(i); 
                        }                 
                } 
                
 </script> 

解决方案 »

  1.   

    if(i>4&&i<6); 后面多了个分号,也就是做完判断后什么都不做~~跟后面输出i不是连在一起的。
      

  2.   

     if   (i> 4   &&   i   <   6); 
    分号去丢.
      

  3.   

    谢谢.你帮我改一下这个好吗?我改不了.
    <script language = "JavaScript">
    function changelocation(locationid)
    {
    var locationid1=parseInt(locationid)*100;
    var locationid2=(parseInt(locationid)+1)*100;
    var i;
        for (i=0;i < onecount; i++)
            {
                if (parseInt(subcat[i][0])>parseInt(locationid1) && parseInt(subcat[i][0]) <  parseInt(locationid2));
                { 
                    document.postart.city_two.options[document.postart.city_two.length] = new Option(subcat[i][1], subcat[i][0]);
                }        
            }
            
        }</script>
      

  4.   

    <script   language   =   "JavaScript"> 
    function   changelocation(locationid) 

    var   locationid1=parseInt(locationid)*100; 
    var   locationid2=(parseInt(locationid)+1)*100; 
    var   i; 
            for   (i=0;i   <   onecount;   i++) 
                    { 
                            if   (parseInt(subcat[i][0])> parseInt(locationid1)   &&   parseInt(subcat[i][0])   <     parseInt(locationid2))
                            {   
                                    document.postart.city_two.options[document.postart.city_two.length]   =   new   Option(subcat[i][1],   subcat[i][0]); 
                            }                 
                    } 
                    
            } </script> 昏倒....
    说了分号去掉了...
    if(parseInt(subcat[i][0])> parseInt(locationid1)&&parseInt(subcat[i][0])<parseInt(locationid2));
    改为
    if(parseInt(subcat[i][0])>parseInt(locationid1)&&parseInt(subcat[i][0])<parseInt(locationid2))