摘要: 首先先要导入pinyin4j-2.5.0.jar 这个jar包 阅读全文
posted @ 2019-05-03 15:31 yvioo 阅读(446) 评论(0) 推荐(0)
摘要: public static String getSixNum() { String str = "0123456789"; StringBuilder sb = new StringBuilder(4); for (int i = 0; i < 6; i++) { char ch = str.charAt(new Random().nextInt(str.length()));... 阅读全文
posted @ 2019-05-03 15:24 yvioo 阅读(2496) 评论(0) 推荐(0)
摘要: 通过判断浏览器的userAgent,用正则来判断是否是ios和Android客户端。代码如下: <script type="text/javascript"> var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 阅读全文
posted @ 2019-05-03 15:23 yvioo 阅读(2776) 评论(0) 推荐(0)
摘要: Enumeration<String> paraNames=request.getParameterNames(); for(Enumeration<String> e=paraNames;e.hasMoreElements()){ String thisName=e.nextElement()+" 阅读全文
posted @ 2019-05-03 15:19 yvioo 阅读(8105) 评论(0) 推荐(0)
摘要: function isDate8(sDate) { if (!/^[0-9]{8}$/.test(sDate)) { return false; } var year, month, day; year = sDate.substring(0, 4); month = sDate.... 阅读全文
posted @ 2019-05-03 15:17 yvioo 阅读(2204) 评论(0) 推荐(0)
摘要: /* 验证手机号 */ function isPhoneNo(phone) { var pattern = /^1[3456789]\d{9}$/; return pattern.test(phone); } 只验证了手机长度和手机首位必须是1开头,第二位必须是3,4,5,6,7,8,9 ,正确返回 阅读全文
posted @ 2019-05-03 15:15 yvioo 阅读(331) 评论(0) 推荐(0)
摘要: 正确返回true 错误返回false isIdCardNo.js function isIdCardNo(num) { var factorArr = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1); var par 阅读全文
posted @ 2019-05-03 15:14 yvioo 阅读(285) 评论(0) 推荐(0)
摘要: public static List getImg(String htmlStr) { List list = new ArrayList(); String img = ""; Pattern p_image; Matcher m_image; // String regEx_img = "]*?>"; //图片链... 阅读全文
posted @ 2019-05-03 15:12 yvioo 阅读(2249) 评论(0) 推荐(0)
摘要: function jqchk(){ //jquery获取复选框值 var chk_value =[]; $('input[class="sel"]:checked').each(function(){ chk_value.push($(this).val()); }); if(chk_value.l 阅读全文
posted @ 2019-04-28 11:43 yvioo 阅读(10035) 评论(0) 推荐(0)
摘要: 总选框: 子选框: /** * 全选 反选 */ $(".all").bind("click",function(){ $(".sel").prop("checked",$(this).prop("checked")); }) $(".s... 阅读全文
posted @ 2019-04-28 11:39 yvioo 阅读(269) 评论(0) 推荐(0)