• 学习进度


    layui给元素绑定事件:

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    
    
    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <title>layer-更懂你的web弹窗解决方案</title>
    
      <style>
      html{background-color:#E3E3E3; font-size:14px; color:#000; font-family:'微软雅黑'}
      a,a:hover{ text-decoration:none;}
      pre{font-family:'微软雅黑'}
      .box{padding:20px; background-color:#fff; margin:50px 100px; border-radius:5px;}
      .box a{padding-right:15px;}
      #about_hide{display:none}
      .layer_text{background-color:#fff; padding:20px;}
      .layer_text p{margin-bottom: 10px; text-indent: 2em; line-height: 23px;}
      .button{display:inline-block; *display:inline; *zoom:1; line-height:30px; padding:0 20px; background-color:#56B4DC; color:#fff; font-size:14px; border-radius:3px; cursor:pointer; font-weight:normal;}
      .photos-demo img{width:200px;}
      </style>
      <script src="jquery-1.8.3.min.js"></script> 
      <script src="../layer-v3.1.1/layer/layer.js"></script>
    </head>
    <script>
    function panduan2(id)
    {
          
          var num=document.getElementById("a").value;
          if(num==0){
              layer.confirm('你还未登录,无法进行操作,请先去登录', {icon: 5, title:'提示'}, function(index){
                  window.location.href="index2.jsp";//还未登录跳转到登录页面
                  layer.close(index);
                });
          }
          else
              {
        window.location.href=("contact2.jsp?place="+id);//登录成功后需要跳转的页面加参数
              }
    }
    </script>
    <body>
    <%
    String loginname="";
    int a=0;
    if(session.getAttribute("username")==null){
        loginname="error";
    }else
    {
        loginname=(String)session.getAttribute("username");
        a=1;
    }
    %>
    <input type="hidden" id="a" value="<%=a%>">
    <div class="box" style="text-align:center">
      <a onclick="panduan2('oo')" id="about">验证</a>
    </div>
    </body>
    </html>
    View Code
  • 相关阅读:
    第一个shell脚本(bash脚本)
    通过Nginx反向代理配置/.well-known/pki-validation/fileauth.txt步骤实例
    Windows注册表中修改UAC(用户账号控制)及批处理脚本
    ssh免密码认证
    ansible快速文档
    devops基础06--maven pom.xml
    java开发基础
    devops基础05--nexus
    devops基础04--maven
    centos7下安装postgresql13
  • 原文地址:https://www.cnblogs.com/zhao-teng-ass/p/12535459.html
Copyright © 2020-2023  润新知