日期:2014-05-16 浏览次数:20442 次
function ToDefiniteURL(){
  switch (document.all.strURL.value) {
   case "1":
       window.location.ref="1.htm";break;
   case "2":
       window.location.ref="2.htm";break;
   default :
       window.location.ref="3.htm";break;
  }
}
------解决方案--------------------
<script>
function tourl(e){
 switch (e){
   case "1":
     location.href="1.html";
     break;
  case "2":
     location.href="2.html";
     break;
  default:
     location.href="3.html";
     break;
 }
}
</script>
<input type="text" name="url">
<input type="sbumit" value="提交" onclick="tourl('url.value')">  
------解决方案--------------------
window.location.ref="1.htm";break;  
改成:
window.location.href="1.htm";break;  
注意红色部分.