随笔分类 - javascript
javascript知识点
摘要:function deepClone(obj, hash = new WeakMap()) { if (obj null) return obj // 如果是null或者undefined我就不进行拷贝操作 if (obj instanceof Date) return new Date(obj)
阅读全文
摘要:iswap(); function iswap() { var uA = navigator.userAgent.toLowerCase(); var ipad = uA.match(/ipad/i) == "ipad"; var iphone = uA.match(/iphone os/i) ==
阅读全文
摘要:// 缓动动画 // 封装缓动动画函数 传递两个参数 需要执行动画的对象和目标位置 function animate (obj,target){ //先把原先的定时器清除,只保留一个. clearInterval(obj.time); obj.time = setInterval( function
阅读全文
摘要:// 保存数据到 sessionStorage sessionStorage.setItem('key', 'value'); // 从 sessionStorage 获取数据 let data = sessionStorage.getItem('key'); // 从 sessionStorage
阅读全文
摘要:1.创建和存储cookie。 // 函数中的参数分别为 cookie 的名称、值以及过期天数function setCookie(c_name,value,expiredays){ var exdate=new Date(); exdate.setDate(exdate.getDate()+expi
阅读全文
摘要:1存数据,将value存储到key字段,如果key存在时,就更新value。 var requesteducatData = { "school": '吉林大学', "startSchoolTime": '2015', "finishSchoolTime": '2019', "schoolTypeI
阅读全文