随笔分类 -  js

摘要:在相应的元素中添加 onselectstart="return false;" 即可阻止选中元素 阻止浏览器选择元素内容:css属性:user-select:none; 阅读全文
posted @ 2020-05-02 19:40 吴小明- 阅读(624) 评论(0) 推荐(0) 编辑
摘要:var arr = [ {name:'zopp',age:0}, {name:'gpp',age:18}, {name:'yjj',age:8} ]; function compare(property){ return function(a,b){ var value1 = a[property] 阅读全文
posted @ 2020-04-20 13:58 吴小明- 阅读(1086) 评论(0) 推荐(0) 编辑
摘要:let arr=[1,2,3,4]; let arr1=[1,2,3,4,5,6,7,8,"a"]; function array_diff(a, b) { for(let i=0;i<b.length;i++){ for(let j=0;j<a.length;j++){ if(a[j] b[i]) 阅读全文
posted @ 2020-04-20 11:18 吴小明- 阅读(1108) 评论(0) 推荐(0) 编辑
摘要:在函数体内操作某个变量时,如何明确这个变量操作的是全局变量还是局部变量? 向上查找,如果在函数体内找到了与该变量相同的变量名,并且这个变量时局部变量,说明该行操作的变量也是局部变量。 向上查找时,如果在函数体内没有找到和该变量相同名称的变量,继续向函数体外查找,如果找到说明该行操作的变量是全局变量。 阅读全文
posted @ 2020-03-14 00:14 吴小明- 阅读(141) 评论(0) 推荐(0) 编辑
摘要:export导出一个变量值,用 import {} 接收 api/request.js utils/utils.js export default导出一个对象,对象中有属性和方法,用 import 变量名 接收,再用对象.属性、对象.方法 api/index.js utils/localStorag 阅读全文
posted @ 2020-03-10 00:15 吴小明- 阅读(478) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> div div { width: 20px; text-align: center; line-height: 20 阅读全文
posted @ 2020-02-28 01:12 吴小明- 阅读(234) 评论(0) 推荐(0) 编辑
摘要:编码 大小 支持语言 ASCII 1个字节 英文 Unicode 2个字节(生僻字4个) 所有语言 UTF-8 1-6个字节,英文字母1个字节,汉字3个字节,生僻字4-6个字节 所有语言 具体解释: 最早只有127个字母被编译到计算机里,也就是大小写字母、数字和一些符号,这个编译表被称为ASCII编 阅读全文
posted @ 2020-02-07 19:04 吴小明- 阅读(1689) 评论(0) 推荐(1) 编辑
摘要:先看下结果: 解析: 首先,在js中,0==false,1==true。 1<2<3的过程: ①先计算1<2的结果为true ②再计算true<3,结果为true 3>2>1的过程: ①先计算3>2的结果为false ②再计算false>1,结果为false 注意:js中连续的>或<是先计算前两个的 阅读全文
posted @ 2020-01-15 15:33 吴小明- 阅读(1269) 评论(0) 推荐(0) 编辑
摘要:audio不仅是一个标签,也是window下的一个对象,作为对象,具有一些对象属性和对象方法: 对象属性: currentTime:获取当前播放时间 duration:获取歌曲的总时间 pause:是否暂停,返回布尔值 对象方法: play():播放 pause():暂停 load():重新加载 < 阅读全文
posted @ 2020-01-13 11:46 吴小明- 阅读(10311) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv 阅读全文
posted @ 2020-01-13 11:18 吴小明- 阅读(4118) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv 阅读全文
posted @ 2020-01-08 15:57 吴小明- 阅读(158) 评论(0) 推荐(0) 编辑
摘要:<?php $data = array( array( 'id' => 5698, 'first_name' => 'Bill', 'last_name' => 'Gates', ), array( 'id' => 4767, 'first_name' => 'Steve', 'last_name' 阅读全文
posted @ 2019-12-28 19:21 吴小明- 阅读(264) 评论(0) 推荐(0) 编辑
摘要:for of只能遍历数组,for in可以遍历数组和对象 推荐用for of遍历数组,for in遍历对象 阅读全文
posted @ 2019-12-28 14:26 吴小明- 阅读(856) 评论(0) 推荐(0) 编辑
摘要:function onet(){ // 得到时间戳 毫秒 var time=new Date().getTime() // 将时间戳转换为 Thu Dec 26 2019 11:22:22 GMT+0800 (中国标准时间) var timer=new Date(time) // 格式化为年月日等等 阅读全文
posted @ 2019-12-27 10:31 吴小明- 阅读(2658) 评论(0) 推荐(0) 编辑
摘要:<input type="checkbox" > <input type="checkbox" > <input type="checkbox" > <input type="checkbox" > <input type="checkbox" > <div></div> var inputs=$( 阅读全文
posted @ 2019-12-25 21:39 吴小明- 阅读(332) 评论(0) 推荐(0) 编辑
摘要:1、狗屁不通文章生成器 https://suulnnka.github.io/BullshitGenerator/index.html 2、在线表情包制作器 https://www.52doutu.cn/maker/2/?order=timedown http://www.doutula.com/m 阅读全文
posted @ 2019-12-14 19:11 吴小明- 阅读(6442) 评论(0) 推荐(0) 编辑
摘要:①打开酷我音乐,输入要下载的歌曲,如:a little love ②按下f12或者右键-检查打开控制台,点击Network,点击XHR,刷新一下浏览器(ctrl+R) ③点击Name下最后一个数据,此时右边会有详细介绍,点击Preview,选中url地址 ④将刚刚复制的地址在新窗口粘贴,回车,就可以 阅读全文
posted @ 2019-12-11 19:04 吴小明- 阅读(3787) 评论(0) 推荐(0) 编辑
摘要:<body> <ul> <li>这是第一行</li> <li>这是第二行</li> <li>这是第三行</li> <li>这是第四行</li> <li>这是第五行</li> </ul> </body> 第一种: var lis=document.getElementsByTagName("li"); 阅读全文
posted @ 2019-12-08 12:09 吴小明- 阅读(1744) 评论(0) 推荐(0) 编辑
摘要:第一种方法: var paramsArray = window.location.search.substr(1).split('&'), i, paramsObj = {}; paramsArray.forEach(function(item){ i = item.indexOf('='); pa 阅读全文
posted @ 2019-12-08 10:33 吴小明- 阅读(647) 评论(0) 推荐(0) 编辑
摘要:①安装插件 此时右击会有: ②anywhere 阅读全文
posted @ 2019-12-06 11:37 吴小明- 阅读(413) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示