How do I remove a particular element from an array in JavaScript?
摘要:9090down voteaccepted 9090down voteaccepted Find the index of the array element you want to remove, then remove that index with splice. The splice() m
阅读全文
posted @
2018-09-06 15:11
今夜太冷
阅读(229)
推荐(0) 编辑
前端 使用 crypto-js 对数据进行对称加密
摘要:From: https://www.cnblogs.com/CyLee/p/7216988.html 传送门: demo1: demo2:
阅读全文
posted @
2018-09-05 17:06
今夜太冷
阅读(3590)
推荐(0) 编辑
如何用 async 控制流程
摘要:来自: http://larry850806.github.io/2016/05/31/async/ [Javascript] 如何用 async 控制流程 (一) 31 May 2016 async async 是一個 Node.js module也可以在前端的 javascript 中直接使用讓
阅读全文
posted @
2018-06-20 17:00
今夜太冷
阅读(256)
推荐(0) 编辑
JavaScript – Convert Image to Base64 String
摘要:From: https://bytenota.com/javascript-convert-image-to-base64-string/ his post shows you two approaches how to convert an image to a Base64 string usi
阅读全文
posted @
2018-05-28 11:41
今夜太冷
阅读(978)
推荐(0) 编辑
he canvas has been tainted by cross-origin data and tainted canvases may not be exported
摘要:来自: https://ourcodeworld.com/articles/read/182/the-canvas-has-been-tainted-by-cross-origin-data-and-tainted-canvases-may-not-be-exported These errors
阅读全文
posted @
2018-05-28 11:07
今夜太冷
阅读(4494)
推荐(0) 编辑
Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
摘要:canvas绘制图片,由于浏览器的安全考虑,如果在使用canvas绘图的过程中,使用到了外域的图片资源,那么在toDataURL()时会抛出安全异常: 解决方案1. 如果想使用toDataURL()生成图片文件的话,在canvas绘图过程中使用的图片应该是当前域下的。 解决方案2. 访问的服务器允许
阅读全文
posted @
2018-05-28 10:59
今夜太冷
阅读(1919)
推荐(0) 编辑
JSON.parse 必须用双引号包起来
摘要:Why is it that whenever I do :- JSON.parse('"something"') it just parses fine but when I do:- var m = "something"; JSON.parse(m); it gives me an error
阅读全文
posted @
2018-05-05 14:25
今夜太冷
阅读(464)
推荐(0) 编辑
Javascript常用语法 (一)
摘要:判断成员是否是一个函数: if (typeof options.sourceMapName === 'function') { mapNameGenerator = options.sourceMapName; } Try/Catch var result; try { result = uglify.minify(availa...
阅读全文
posted @
2017-11-08 15:18
今夜太冷
阅读(171)
推荐(0) 编辑
Jquery的分页插件
摘要:Jquery的分页插件, 用起来还不错。 来自: http://flaviusmatis.github.io/simplePagination.js/ 下载地址: https://github.com/flaviusmatis/simplePagination.js
阅读全文
posted @
2017-11-03 10:11
今夜太冷
阅读(132)
推荐(0) 编辑
Window.sessionStorage
摘要:ThesessionStorageproperty allows you to access a sessionStorageobject for the current origin. sessionStorage is similar toWindow.localStorage, the only difference is while data stored in localS...
阅读全文
posted @
2017-10-19 17:07
今夜太冷
阅读(1680)
推荐(0) 编辑
How to skip to next iteration in jQuery.each() util?
摘要:[问] I'm trying to iterate through an array of elements. jQuery's documentation says: jquery.Each() documentation Returning non-false is the same as a continue statement in a for loop, it will skip...
阅读全文
posted @
2017-08-23 14:33
今夜太冷
阅读(184)
推荐(0) 编辑
在javascript中substr和substring的区别是什么
摘要:1.substring 用于提取字符串中介于两个指定下标之间的字符 substring(start,end) 开始和结束的位置,从零开始的索引 substring 方法返回的子串包括 start 处的字符,但不包括 end 处的字符。 如果 start 与 end 相等,那么该方法返回的就是一个空串(即长度为 0 的字串)。...
阅读全文
posted @
2017-08-23 11:10
今夜太冷
阅读(317)
推荐(0) 编辑
jssor/slider图片的问题
摘要:用jssor/slider这个控件,在显示图片的时候,每张图片都被拉伸到最大的图片的宽度和高度,导致变形,怎么处理? 【答案】 Yes. With no u="image" image will keep original size (or the size specified by css manually). function ShowSlideShows(fileIds) ...
阅读全文
posted @
2017-07-30 02:02
今夜太冷
阅读(431)
推荐(0) 编辑
Jquery中的高度
摘要:$('.someElement').height(); // returns the calculated pixel height of the element(s) $(window).height(); // returns height of browser viewport $(document).height(); // returns ...
阅读全文
posted @
2017-07-28 11:23
今夜太冷
阅读(105)
推荐(0) 编辑
如何用Javascript检测到所有的IE版本
摘要:如何用Javascript检测到所有的IE版本 function GetIEVersion() { var sAgent = window.navigator.userAgent; var Idx = sAgent.indexOf("MSIE"); // If IE, return version number. if (Idx > 0) return parseIn...
阅读全文
posted @
2017-03-24 17:03
今夜太冷
阅读(244)
推荐(0) 编辑
Javascript中计算脚本运行的时间
摘要:console.time("timer名字") 其他脚本 console.timeEnd("timer名字"); 运行后结果为: timer名字: 运行时间 console.time("timer名字") 其他脚本 console.timeEnd("timer名字"); 运行后结果为: timer名
阅读全文
posted @
2016-04-12 14:17
今夜太冷
阅读(424)
推荐(0) 编辑
如何用 Jquery实现OuterHtml
摘要:$(this).get(0) 或者$(this).prop('outerHTML')
阅读全文
posted @
2015-05-14 18:58
今夜太冷
阅读(906)
推荐(0) 编辑