kenlistian

勤学多思

  IT博客 :: 首页 :: 新随笔 ::  :: 聚合  :: 管理 ::
  412 随笔 :: 0 文章 :: 23 评论 :: 0 Trackbacks
网上的帖子贴来贴去,的确都是差不多,贴在自己的博客上也不是图个
什么,只是每次查询时不再用google搜,直接在自己博客copy用一下。
图个实用而已。

第一种:
    <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("你确定要注销身份吗?\n是-选择确定,否-选择取消")){
     window.location.href="logout.asp?act=logout"
   }
}
</script>

<script language="javascript">
function logout(){
    alert("你确定要注销身份吗?");
    window.location.href="logout.asp?act=logout"
}
</script>
ASP中直接跳转到其他页面
<% response.redirect "logont.asp" %>

Html中确认后弹出新页面
function Del(id)
{
   if (confirm("你确定要删除吗?"))
   {
      window.open("otherfile.asp?ID="+id+"&act=del","top","width=640,height=400")
   }
}
Html中确认后跳转到其他页面 
function Del(URL)
{
   if (confirm("你确定要删除吗?"))
   {
      //URL="otherfile.htm"
      window.location.href=URL
   }
}

按钮式:  <INPUT name="pclog" type="button" value="GO" onClick="location.href='http://asdfa.cn/'">
链接式:   <a href="javascript:history.go(-1)">返回上一步</a>
          <a href="<%=Request.ServerVariables("HTTP_REFERER")%>">返回上一步</a>
直接跳转式:
         <script>window.location.href='http://www.asdfas.cn';</script>
开新窗口:
      <a href="javascript:" onClick="window.open('http://www.asdasa.cn/235.html','','height=500,width =611,scrollbars=yes,status=yes')">ddasdfasd</a>

1.
<script language="javascript">
    window.location = "http://www.baidu.com";
</script>
2
<script language="javascript">
    document.location = "http://www.baidu.com";
</script>
3: (带进度条)
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<title>跳转到baidu.com</title>
</head>
<body>
<form name=loading>
<P align=center><FONT face=Arial color=#0066ff size=2>loading...</FONT>
<INPUT style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bolder; PADDING-BOTTOM: 0px; COLOR: #0066ff; BORDER-TOP-style: none; PADDING-TOP: 0px; FONT-FAMILY: Arial; BORDER-RIGHT-style: none; BORDER-      LEFT-style: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-style: none"  size=46 name=chart>
<BR>
<INPUT style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; COLOR: #0066ff; BORDER-BOTTOM: medium none; TEXT-ALIGN: center" size=47 name=percent>
<script language="javascript">
var bar=0
var line="||"
var amount="||"
count()

function count(){
    bar=bar+2
    amount =amount + line
    document.loading.chart.value=amount
    document.loading.percent.value=bar+"%"
    if (bar<99){
        setTimeout("count()",100);
    }else{
        window.location = "http://www.baidu.com/";
    }
}
</script>
</P>
</form>
</body>
</html>
 
 


 
posted on 2008-04-16 17:22 kenlistian 阅读(3658) 评论(0)  编辑 收藏 引用 所属分类: WEB
只有注册用户登录后才能发表评论。