Written on 2010年1月16日 @ 17:37 | by spirit | Tags: asp  Javascript   | 浏览:

我想单击下按钮会在弹出一个新的窗体显示我要转到的页面,请如何在单击事件下写代码?

=====javascript中弹出选择框跳转到其他页面=====
<script language="javascript">
<!--
function logout(){
if (confirm("你确定要注销身份吗?\n是-选择确定,否-选择取消")){
window.location.href="logout.asp?act=logout"
}
}
-->
</script>


=====javascript中弹出提示框跳转到其他页面=====
<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
  }
  }

=======================================================

 Response.Write "<script>location.href='URL'</script>"
这种方法还算比较常见了,主要用于弹出对话窗口之后来跳转,例如:
Response.Write "<script>alert('登录成功');location.href='index.asp'</script>"

来源:网页制作教程


若转载请注明出处: Spirit's Home
本文地址: http://www.7788sky.cn/post/ASP-Javascript-asp-redirect-code.html

相关文章:

  1. 1 Response to “Javascript,asp页面跳转代码”

  2. By 赢在网络 on 2010-1-18 23:51:41| http://www.8dianpu.com/blog/

    常用代码,可以备忘。

Post a Comment

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。