![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
葉幺
实在 乐于研究
展开
-
js xlsx 转json数据(叶笔记)
xlsx 转json原创 2022-02-15 11:21:45 · 1047 阅读 · 0 评论 -
网络图片转成base64
urlTobase64(url){ // #ifdef MP-WEIXIN uni.getFileSystemManager().readFile({ filePath: url, //选择图片返回的相对路径 encoding: 'base64', //编码格式 success: res => { //成功的回调 ...原创 2021-07-27 16:01:05 · 1076 阅读 · 1 评论 -
js获取当前经纬度
if(navigator.geolocation) { navigator.geolocation.getCurrentPosition( //locationSuccess 获取成功的话 function(position) { let getLongitude = position.coords.longitude; let getLatitude = position.coords.latitude; // alert(getLongitude) //弹原创 2021-04-14 09:28:11 · 1512 阅读 · 1 评论 -
js添加水印,防穿透
html<div id="mainFrame" style="background:url('bg.jpg') no-repeat;background-size:100% 100%;width:1200px;height:600px;position:relative;"> <div style="position:absolute;"> 你好 我是测试内容 </div> </div>js/** * 文字水印效果 * id 要加水原创 2021-03-16 16:31:22 · 830 阅读 · 0 评论 -
jq 在当前li下添加.on移除兄弟li下面的.on 获取当前li的下标
html<ul> <li class="on">li1111</li> <li>li2222</li> <li>li3333</li> <li>li4444</li></ul>js$("ul li").click(function(){ $(this).addClass("on").siblings().removeClass('on') // 在当前li下添加.o原创 2020-11-02 09:33:13 · 798 阅读 · 1 评论 -
pc 移动端点击事件
PC端的事件有:click(点击)、dbclick、mousemove、mouseover、mouseout、load等而移动端采用的是:tap(敲击)、taphold(长按)、swipe|swipeleft|swiperight(滑动)、scrollstart|scrollstop(滚动)、pageload(加载)等...原创 2020-06-29 11:06:32 · 719 阅读 · 0 评论 -
var let const 区别
var定义的变量,没有块的概念,可以跨块访问, 不能跨函数访问。let定义的变量,只能在块作用域里访问,不能跨块访问,也不能跨函数访问。const用来定义常量,使用时必须初始化(即必须赋值),只能在块作用域里访问,而且不能修改。'use strict';let a = 5;a = 20;console.log(a) // 输出20var b = 5;b = 20;console.log(b); // 输出20const d = 5;console.log(d) /原创 2020-06-22 09:53:15 · 490 阅读 · 0 评论 -
vue 一些可用方法或者容易忽略的监听事件或方法
使用watch时,当值第一次绑定的时候,不会执行监听函数,只有值发生改变才会执行。data() { return { searchName:'' }},watch: { // 当searchName发生变化时执行 searchName:function(e){ console.log(e) }} ...原创 2020-06-18 09:52:22 · 660 阅读 · 0 评论 -
js获取单选跟复选内容
单选<input name="radioType" type="radio" value="苹果">苹果<input name="radioType" type="radio" value="香蕉">香蕉<input name="radioType" type="radio" value="杨梅">杨梅 var obj = document.getElementsByName("radioType"); var type = '' for(var i =原创 2020-06-09 12:05:37 · 650 阅读 · 0 评论 -
es6练习
let a = new Set([1,2,3]) let b = new Set([4,1,3]) let unique = new Set([...a,...b]) // 并集let inter = new Set([...a].filter(x=>b.has(x))) // 交集console.log(unique) // 1,2,3,4consol...原创 2019-12-05 15:21:11 · 844 阅读 · 0 评论 -
常用正则
正则匹配网站:http://tool.chinaz.com/regex一、校验数字的表达式 1 数字:^[0-9]*$ 2 n位的数字:^\d{n}$ 3 至少n位的数字:^\d{n,}$ 4 m-n位的数字:^\d{m,n}$ 5 零和非零开头的数字:^(0|[1-9][0-9]*)$ 6 非零开头的最多带两位小数的数...原创 2019-11-29 10:52:21 · 480 阅读 · 0 评论 -
前端常见操作,问题,兼容等链接
先收藏链接链接1 http://www.h-ui.net/bug.shtml后期添加链接原创 2019-11-06 11:34:17 · 117 阅读 · 0 评论 -
jq常见方法
选择父元素 $(“span”).parent();选择所有父元素$(“span”).parents();选择所有父元素的ul $(“span”).parents(“ul”);选择所有.box直接子元素$(".box").children();选择.box下面所有子孙元素 $(".box").find("*")选择.box所有的兄弟元素$(".box").siblings();选择.b...原创 2019-11-07 14:56:19 · 173 阅读 · 0 评论