情况大致是这样的,我在首页中编辑了这样一段代码:
 
  var   srcc   =   window.location;       //得到地址栏连接   
  srcc   =   srcc.toString()     //转换成string类型,可以省略   
  if(srcc=="http://test.com"){
    window.navigate("test/index.html");
  }
如果我输入后得到的信息是“http://test.com”应该跳转到test/index.html,可是我上传到虚拟主机上测试后没有跳转,是怎么回事?

解决方案 »

  1.   

    "test/index.html" ----->  "test//index.html"
    ??
      

  2.   

    我用你这个测试是会跳转的<script>
    var  srcc  =  window.location;
      srcc  =  srcc.toString();
      if(srcc=="http://localhost:8080/xx/a.html"){ 
        window.navigate("http://localhost:8080/xx/b.html"); 
      } 
    </script>
    <body>
    <div id="aa">a</div>
    </body>
      

  3.   

    你把代码改成:
    var  srcc  =  window.location.href;
    试试!