随笔分类 -  JS、JQuery

记录,便于查阅。
摘要:javascript中函数传参,传字符串,它会自动将传递的字符串当作是一个变量放在函数里面,所以就会出现undefined的报错。 需要对传递的字符串进行转义处理 \' '+参数+' \' \' 单引号 阅读全文
posted @ 2021-06-15 13:40 我和我的小生活 阅读(2690) 评论(0) 推荐(0)
摘要:css: user-select: none; user-select不是一个W3C的标准,浏览器的支持不完整,需要对不同的浏览器进行调整 body{ -moz-user-select:none;/*火狐*/ -webkit-user-select:none;/*webkit浏览器*/ -ms-us 阅读全文
posted @ 2021-05-17 11:00 我和我的小生活 阅读(256) 评论(0) 推荐(0)
摘要:毕设,登录注册页面,由于我写的导航栏是公用组件,所以注册需要重新写一个页面。 然后当我将代码拷贝粘贴好之后,点击登录注册不行了,报错如下: 原来id是和方法名相同了,执行顺序会先找到HTML控件,需要任意改一个,又是在执行顺序上入坑... 阅读全文
posted @ 2021-03-04 10:39 我和我的小生活 阅读(457) 评论(0) 推荐(0)
摘要:以当前时间为例: 时间戳转为年月日: var d=new Date(); var year=d.getFullYear(); var month=formater(d.getMonth()+1); var date=formater(d.getDate()); var gettime=[year,m 阅读全文
posted @ 2021-03-01 16:08 我和我的小生活 阅读(5372) 评论(0) 推荐(0)
摘要:function downloadDocument () { var href="/xxxxxxxx/xxxxxxxx" window.open(href,'_self'); //在当前页面打开 } 阅读全文
posted @ 2020-12-15 17:01 我和我的小生活 阅读(4265) 评论(0) 推荐(0)
摘要://邮箱验证,网上找到的正则var RegEmail = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/; 阅读全文
posted @ 2020-12-11 10:43 我和我的小生活 阅读(2312) 评论(0) 推荐(0)
摘要:$('dl').hide(); $(function () { $("li.mainmenu").mouseover(function () { $(this).children("dl").show(); }) }) $(function () { $("li.mainmenu").mouseou 阅读全文
posted @ 2020-12-11 10:42 我和我的小生活 阅读(570) 评论(0) 推荐(0)
摘要://Check to see if the window is top if not then display button $(window).scroll(function () { if ($(this).scrollTop() > 300) { $('.scrollToTop').fadeI 阅读全文
posted @ 2020-12-11 10:40 我和我的小生活 阅读(94) 评论(0) 推荐(0)
摘要:goToDetailView(Id,StartDate,EndDate) { let date = new Date(); let startdate=new Date(StartDate); let enddate=new Date(EndDate); if(date>=startdate && 阅读全文
posted @ 2020-12-11 10:39 我和我的小生活 阅读(108) 评论(0) 推荐(0)
摘要:var url = document.location.toString(); var arrObj = url.split("/");//获取路由名字 var routeName = arrObj[7]; if (routeName == "detailbudget?itemID=24") { b 阅读全文
posted @ 2020-12-11 10:37 我和我的小生活 阅读(87) 评论(0) 推荐(0)
摘要:function getYearMsg() { var year = new Date().getFullYear(); return 'BMW China ' + year;} 阅读全文
posted @ 2020-12-11 10:36 我和我的小生活 阅读(159) 评论(0) 推荐(0)
摘要:function getUrlParam(paraName) { var url = document.location.toString(); //alert(url); var arrObj = url.split("?");//id=3 name=jack if (arrObj.length 阅读全文
posted @ 2020-12-11 10:32 我和我的小生活 阅读(286) 评论(0) 推荐(0)
摘要:function clearSeach() { $("#processid").val(""); $("#candidateid").val(""); $("#typeid").val(""); $("#entityid").val(""); $("#departmentid").val(""); 阅读全文
posted @ 2020-12-11 10:31 我和我的小生活 阅读(261) 评论(0) 推荐(0)
摘要:email格式: var re = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 阅读全文
posted @ 2020-12-11 10:30 我和我的小生活 阅读(532) 评论(0) 推荐(0)
摘要:timeFormat() { let data = new Date(); let year = data.getFullYear(); //获取年 let month = data.getMonth() + 1; //获取月 let day = data.getDate(); //获取日 retu 阅读全文
posted @ 2020-12-11 10:29 我和我的小生活 阅读(141) 评论(0) 推荐(0)
摘要://时间格式转换function timeFormat(time) { var data = new Date(time); var year = data.getFullYear(); //获取年 var month = data.getMonth() + 1; //获取月 var day = d 阅读全文
posted @ 2020-12-11 10:28 我和我的小生活 阅读(110) 评论(0) 推荐(0)
摘要:body{ background-image:url(../src/assets/imgs/login.png); background-size:cover; background-repeat:no-repeat ; background-size:100% 100%; background-a 阅读全文
posted @ 2020-12-11 10:27 我和我的小生活 阅读(97) 评论(0) 推荐(0)
摘要:function textIsNullOrEmpty(textValue) { return (textValue == undefined || textValue == null || $.trim(textValue) == "");} 阅读全文
posted @ 2020-12-10 19:18 我和我的小生活 阅读(174) 评论(0) 推荐(0)
摘要:function arrayIsNull(arrayValue) { return (arrayValue == undefined || arrayValue == null || arrayValue.length == 0);} 阅读全文
posted @ 2020-12-10 19:16 我和我的小生活 阅读(842) 评论(0) 推荐(0)
摘要:display:none visibility:hidden同:都是将网页上的某个元素隐藏起来,但是display:none会连原先元素的位置一并隐藏 visibility:hidden则只是让这个元素变得透明,它所占的位置还是在页面上 阅读全文
posted @ 2020-12-10 19:15 我和我的小生活 阅读(123) 评论(0) 推荐(0)