zoukankan      html  css  js  c++  java
  • 在jsp里面如何用按钮跳转(转自http://oracleabc-126-com.iteye.com/blog/941739)自己留着学

    一个登陆页面,登陆按钮是通过表单来实现,但注册按钮就是想不来用什么方法跳转到另一个页面。使用FUNCTION等多个方法后都行不通。 

    经过坚持不懈的搜索,在百度一个不干起眼的角落找到了,只一句代码就OK了。 

    按它的关键字又在CSDN上找到了一些,在此总结一下 

    № <input type="button" value="注册" onClick="window.location.href='register.jsp'"> 
    (在当前页面打开reg.jsp) 

    № <input type="button" value="注册" onclick="javascript:location.href='reg.jsp'"> 
    (在当前页面打开reg.jsp) 

    № <input type="button" value="注册"  onclick="window.open('reg.jsp')"> 
    (在新的页面打开reg.jsp) 

    № <form   name=ok   action="xx.jsp"   method=post>  
        <input type="button" value="注册" onClick="goo(a,b)">  
       <input   type=hidden   name=xx>  
       <input   type=hidden   name=yy>  
       </form>  
       
       <script   language="javascript">  
        function   goo(a,b){  
           xx.value=a;  
           yy.value=b;  
           formname.submit();  
        }  
        </script>

  • 相关阅读:
    切片
    类型断言
    方法表达式
    接口
    函数式编程
    多人聊天室
    反射
    yarn基础解释
    webpack基础概念
    ssh登陆报错:packet_write_wait: Connection to x.x.x.x port 22: Broken pipe
  • 原文地址:https://www.cnblogs.com/houtaoliang/p/4481147.html
Copyright © 2011-2022 走看看