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