随笔分类 -  前端开发

摘要:什么是 ThreadLocal? ThreadLocal 是 Java 中的一个类,用于为每个线程提供独立的变量副本,实现线程隔离。每个线程访问 ThreadLocal 变量时,操作的是自己的副本,互不干扰。 为什么使用 ThreadLocal? 线程安全:通过为每个线程提供独立的变量副本,避免多线 阅读全文
posted @ 2019-01-22 13:39 lvlin241 阅读(171) 评论(0) 推荐(0)
摘要:// 检索(字符串中判断是否包含某个字符) 字符串.search('检索的内容');// 返回-1,不包含; 返回非-1,包含 字符串.indexOf("待判断的内容"); // 截取 字符串.substr(起始位置,长度); 字符串.substring(起始位置,长度); 示例: var a = "as far as i known, xxx is handsome"; b = a.sub... 阅读全文
posted @ 2019-01-22 12:09 lvlin241 阅读(3795) 评论(0) 推荐(0)
摘要:属性设置为display:inline或display:inline-block 阅读全文
posted @ 2018-11-26 20:19 lvlin241 阅读(11642) 评论(0) 推荐(0)
摘要:var a = 2.34567; var b = a.toFixed(3); // 输出结果:2.346 // 数字字符串转换为数字 var c = "123"; typeof c; // string var d = parseInt(c); typeof d; // number var e = parseInt(c); typeof e; // number 阅读全文
posted @ 2018-11-26 20:17 lvlin241 阅读(301) 评论(0) 推荐(0)
摘要:原因: IE和Firefox是不支持含有'-'字符的日期格式,如:"2018-11-23" 解决方法: 日期格式 'yyyy-mm-dd' 改成 'yyyy/mm/dd' 代码: var dataParam = "2018-11-23 15:45:18"; // 转换为时间戳 var timestamp = Date.parse(new Date(data... 阅读全文
posted @ 2018-11-23 15:48 lvlin241 阅读(428) 评论(0) 推荐(0)
摘要:解决方法如下: 1、在Firefox浏览器的地址栏中输入about:config,即打开Firefox的配置页面 2、然后搜索dom.allow_scripts_to_close_windows,找到后你会发现该配置的默认值是false,右键选择Toggle选项,选择切换,将值修改为true即可. 阅读全文
posted @ 2018-09-29 13:39 lvlin241 阅读(305) 评论(0) 推荐(0)
摘要:1、通过URL传递并接受 阅读全文
posted @ 2018-09-28 17:56 lvlin241 阅读(129) 评论(0) 推荐(0)
摘要:参考:https://blog.csdn.net/qq_27446553/article/details/52433375 1、a href="_blank" 添加属性 rel="noreferrer" 2、window.ope var newWindow = window.open("跳转链接") 阅读全文
posted @ 2018-09-12 14:07 lvlin241 阅读(1259) 评论(0) 推荐(0)
摘要:background-color:transparent; 阅读全文
posted @ 2018-09-06 14:41 lvlin241 阅读(3017) 评论(0) 推荐(0)
摘要:思路:把对象转换为字符串进行传递 参考:https://blog.csdn.net/shuai870081885/article/details/51283390 阅读全文
posted @ 2018-09-06 11:41 lvlin241 阅读(1095) 评论(0) 推荐(0)
摘要:/** * 时间戳转换为日期 */ function convertTimestamp(timestamp){ // 时间戳转换为日期 var d = new Date(timestamp); // 日期按指定格式输出(例如: 2018-09-03 17:09:45) var year = date.getFullYear(); var month = ... 阅读全文
posted @ 2018-09-03 17:45 lvlin241 阅读(469) 评论(0) 推荐(0)
摘要:参考: https://blog.csdn.net/dandelion_drq/article/details/79270597 改变Y轴单位:https://www.cnblogs.com/conserdao/p/6911048.html 阅读全文
posted @ 2018-08-30 12:03 lvlin241 阅读(955) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/young_gao/article/details/78341317 阅读全文
posted @ 2018-07-15 13:12 lvlin241 阅读(144) 评论(0) 推荐(0)
摘要:$("#selectId")[0][0].selected = true; 阅读全文
posted @ 2018-07-15 13:11 lvlin241 阅读(979) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/sxdcgaq8080/p/8119186.html 阅读全文
posted @ 2018-07-15 13:03 lvlin241 阅读(233) 评论(0) 推荐(0)