• jsp页面部分知识点[一直更]


    【1】:除去页面空行

     <%@ page trimDirectiveWhitespaces="true" %>

    【2】:加标题左侧图标

        <!--  '/image/horse.ico' 为项目中的ico图标路径 -->
         <link rel="shortcut icon" href="<%=path %>/image/horse.ico" type="image/x-icon"/>
    

      

    【3】:js获取当前上网国家/省份/城市

      var country = '';
      var province = '';
      var scity = '';
      $.getScript('http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js', function() {
        country = remote_ip_info.country;
        province = remote_ip_info.province;
        city = remote_ip_info.city;
      });

     【4】判断设备类型,用于区分PC与移动端

    //判断设备类型,用于区分PC与移动端
    function getDeviceType() {
        var dtype="00";
        var sUserAgent = navigator.userAgent.toLowerCase();
        var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
        var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
        var bIsMidp = sUserAgent.match(/midp/i) == "midp";
        var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
        var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
        var bIsAndroid = sUserAgent.match(/android/i) == "android";
        var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
        var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
        if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
            dtype="01";//移动
        }
        return dtype;
    }
  • 相关阅读:
    防止人为误操作MySQL数据库技巧一例
    keepalived(nginx的高可用)安装文档
    Nginx安装手册
    每天学点Shiro-多realm
    每天学点Shiro-盐值加密
    每天学点Shiro-登录功能demo
    每天学点Shiro-集成spring
    每天学点Shiro-say hello
    每天学点SpringMVC-异常处理
    每天学点SpringMVC-拦截器
  • 原文地址:https://www.cnblogs.com/ai211234/p/6381668.html
Copyright © 2020-2023  润新知