随笔分类 -  js

摘要:function addLink() { let body_element = document.body; let selection = window.getSelection(); let locationHref = document.location.href; let appendLin 阅读全文
posted @ 2021-06-12 13:47 执笔coding 阅读(119) 评论(0) 推荐(0)
摘要://用于登录过期之后回到登录页 $.ajaxSetup({ complete:function(XMLHttpRequest,textStatus){ if(textStatus=="parsererror"){ window.location.href = '/'; } else if(textS 阅读全文
posted @ 2020-08-14 14:33 执笔coding 阅读(512) 评论(0) 推荐(0)
摘要:一般不做特别设置登录失效会在小窗口弹出登录页面,这样影响整体视觉效果,所以在登录添加判断当前是否是在父窗口 if (top.location.href.indexOf("login") 1) { top.location.href = '/'; } 阅读全文
posted @ 2020-08-14 14:19 执笔coding 阅读(1604) 评论(0) 推荐(0)
摘要:{{# layui.each(d.roles, function(index, item){ }} <span class="layui-badge layui-bg-blue">{{ item.roleName}}</span> {{# }); }} 阅读全文
posted @ 2020-08-06 11:21 执笔coding 阅读(8417) 评论(0) 推荐(1)
摘要:$.ajax({ type: "POST", url:"url", data:$('#form').serialize(),// 序列化表单值 async: false, error: function(request) { //失败的话 }, success: function(data) { } 阅读全文
posted @ 2020-07-22 10:32 执笔coding 阅读(208) 评论(0) 推荐(0)
摘要:function copyToClipboard(s){ if(window.clipboardData){ window.clipboardData.setData('text',s); }else{ (function(s){ document.oncopy=function(e){ e.cli 阅读全文
posted @ 2019-12-20 10:19 执笔coding 阅读(844) 评论(0) 推荐(0)
摘要:$.ajax({ type: 'POST', url: "url", data: { appName: appName, op: appStatus }, dataType: "JSON", success:function(res) { console.log(res); $("#status"+ 阅读全文
posted @ 2019-11-07 09:36 执笔coding 阅读(120) 评论(0) 推荐(0)