java开发 笔记

1.jquery 使用append 进行大量操作是 会导致 内存溢出
解决:使用原生代码
参考:http://caibaojian.com/jquery-performance-optimization.html
原因分析:jquery 针对 append html 操作 先解析 字符串 再生成 node element

2.修改代码 要级联修改相关的部分

3.ios 点击事件 不是click 而是 touchStart

4.多层 div 点击事件 穿透问题
解决:隐藏下层DIV

5.中文首字母提取,姓氏 发音
6.通过
/**
* 获取IP地址
* @param request
* @param response
* @param loginName
* @return
* @throws  
*/
public static String getWebIp(HttpServletRequest request,HttpServletResponse response) {
String ip = request.getHeader("x-forwarded-for"); 
   if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 
       ip = request.getHeader("Proxy-Client-IP"); 
   } 
   if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 
       ip = request.getHeader("WL-Proxy-Client-IP"); 
   } 
   if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 
       ip = request.getRemoteAddr(); 
   } 
   return ip;
}
获取用户IP地址可能为:223.104.33.67, 123.151.42.47
7.事务里保存数据 再查询 是查询不到数据的
8.获取重定向Url时 获取 queryString
request.getQueryString()==null?"":"?"+request.getQueryString()).toString()

9.ie document.head 不兼容,需要使用document.getElementsByTagName('head')[0]

10.使用System.getProperty("catalina.base") 获取tomcat 路径

11. maven 下载失败时 删除m2文件夹下的 相关目录 重试 

12.update project 会根据pom 文件 改变 部署规则

13.ie 兼容性代码

<!--[if lt IE 7]>      <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html lang="en" ng-app="myApp" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en" class="no-js"> <!--<![endif]-->


<!–[if lte IE 8]> 
<meta http-equiv=”x-ua-compatible” content=”ie=7″ /> 
<![endif]–> 
<!–[if IE 9]> 
<meta http-equiv=”x-ua-compatible” content=”ie=9″ /> 
<![endif]–> 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值