js跳转页面方法

 

JS跳转页面参考代码
第一种:    
<script language="javascript" type="text/javascript">
window.location.href="login.jsp?backurl="+window.location.href;
</script>
第二种:    
<script language="javascript">
alert("返回");
window.history.back(-1);   
</script>
第三种:   
<script language="javascript">
window.navigate("top.jsp");  
</script>
第四种:   
<script language="JavaScript">          
self.location=’top.htm’;   
</script>
第五种:   
<script language="javascript">          
alert("非法访问!");          
top.location=’xx.jsp’;   
</script>

=====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>

=================================
按钮式:
<INPUT name="pclog" type="button" value="GO" onClick="location.href='http://www.51wisdom.com.cn/'">

  链接式:

  <a href="javascript:history.go(-1)">返回上一步</a>

  <a href="<%=Request.ServerVariables("HTTP_REFERER")%>">返回上一步</a>

  直接跳转式:

  <script>window.location.href='http://www.51wisdom.com.cn/';</script>

  开新窗口:

  <a href="javascript:" onClick="window.open(http://www.51wisdom.com.cn/','','height=500,width=611,scrollbars=yes,status=yes')">杭州威士顿网络科技有限公司 </a>

js跳转到页面

 

自己的:

function toUrl(ul){
if("" == ul || null==ul){
         alert("感谢关注");
      }else{
                   
                  window.open(ul);//这是跳出新的窗口

                 // window.location.href=ul;//这是直接在当前页跳转


       }
               return;
}    
其他的网上的:(有重复)

 

1.在原来的窗体中直接跳转用
window.location.href="你所要跳转的页面";
2、在新窗体中打开页面用:
window.open('你所要跳转的页面');

window.history.back(-1);返回上一页

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值