JavaScript 各种页面跳转方法

第一种:

window.location.href="login.jsp?backurl="+window.location.href; 

第二种:

alert("返回"); 
window.history.back(-1); 

第三种:

window.navigate("top.jsp"); 

第四种:

self.location='top.htm'; 

第五种:

alert("非法访问!"); 
top.location='xx.jsp'; 

=====javascript中弹出选择框跳转到其他页面=====

<script language="javascript"> 
<!-- 
function logout(){ 
    if (confirm("你确定要注销身份吗?是-选择确定,否-选择取消"))...{ 
        window.location.href="logout.asp?act=logout" 
    } 
} 
--> 
</script>

=====javascript中弹出提示框跳转到其他页面=====

<script language="javascript"> 
<!-- 
function logout(){ 
    alert("你确定要注销身份吗?"); 
    window.location.href="logout.asp?act=logout" 
} 
--> 
</script>
原文地址:https://www.cnblogs.com/xyyt/p/3980096.html