随笔分类 -  前端基础

摘要:非跨域,downLoad属性 跨域 downLoadImg=(imgsrc, name)=>{ let image = new Image(); // 解决跨域 Canvas 污染问题 image.setAttribute("crossOrigin", "anonymous"); image.onl 阅读全文

posted @ 2022-01-18 16:47 博客sl 阅读(158) 评论(0) 推荐(0)

摘要:WeakMap和Map的区别 如果是普通的值类型则不允许。比如:字符串,数字,null,undefined,布尔类型。而Map结构是允许的,这就是两者的不同之处,谨记。 跟Map一样,WeakMap也拥有get、has、delete方法,用法和用途都一样。不同地方在于,WeakMap不支持clear 阅读全文

posted @ 2021-02-20 15:23 博客sl 阅读(628) 评论(0) 推荐(0)

摘要:if(window.console && window.console.log) { console.info("%c ", "background: url(https://images.cnblogs.com/cnblogs_com/miluluyo/1493340/o_a.gif) no-re 阅读全文

posted @ 2021-02-20 14:18 博客sl 阅读(445) 评论(0) 推荐(0)

摘要:test分支上的代码完全覆盖dev分支,首先切换到dev分支git checkout dev 然后直接设置代码给远程的test分支上的代码git reset --hard origin/test 执行上面的命令后dev分支上的代码就完全被test分支上的代码覆盖了,注意只是本地分支,这时候还需要将本 阅读全文

posted @ 2020-12-24 16:07 博客sl 阅读(1460) 评论(0) 推荐(1)

摘要:https://www.jianshu.com/p/8f9961a10e5b 1,引入 js-xlsx npm install xlsx或<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0 阅读全文

posted @ 2020-09-24 17:40 博客sl 阅读(1336) 评论(0) 推荐(0)

摘要:作者:java高并发框架链接:https://zhuanlan.zhihu.com/p/145837536来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 1.通过JSONP 利用 <script> 标签没有跨域限制的漏洞,网页可以得到从其他来源动态产生的 JSON 数 阅读全文

posted @ 2020-06-19 14:12 博客sl 阅读(214) 评论(0) 推荐(0)

摘要:ajax的请求比普通请求多了一个“X-Requested-With”属性。 如果 requestedWith 为 XMLHttpRequest 则为 Ajax 请求。 String requestedWith = ((HttpServletRequest) request).getHeader("X 阅读全文

posted @ 2020-06-18 17:48 博客sl 阅读(297) 评论(0) 推荐(0)

摘要:原生JS发送Ajax请求、JSONP <script type="text/javascript">//调用ajax函数ajax({url:'./TestXHR.aspx',type:'POST',dataType:'json',data:{name:"马各马它",age:18},success:f 阅读全文

posted @ 2020-06-18 15:40 博客sl 阅读(944) 评论(0) 推荐(0)