会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
null
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
···
18
下一页
2021年2月27日
js正则表达式 (.+)与(.+?)
摘要: (.+)默认是贪婪匹配 (.+?)为惰性匹配 疑问号让.+的搜索模式从贪婪模式变成惰性模式。 var str = 'aaa<div style="font-color:red;">123456</div>bbb' <.+?>会匹配<div style="font-color:red;"> <.+>会
阅读全文
posted @ 2021-02-27 13:38 6NULL9
阅读(363)
评论(0)
推荐(0)
2021年2月26日
javaScript中的继承
摘要: 借用原型链 通过prototype属性 function SuperType() { this.superType = 'SuperType'; } SuperType.prototype.getSuper = function() { return this.superType; } functi
阅读全文
posted @ 2021-02-26 16:24 6NULL9
阅读(51)
评论(0)
推荐(0)
2021年2月25日
理解javascript中event loop,
摘要: console.log(1) setTimeout(() => console.log(2), 0) new Promise((resolve, reject) => { console.log(3) resolve() }).then(() => { console.log(4) }) // 1
阅读全文
posted @ 2021-02-25 16:30 6NULL9
阅读(95)
评论(0)
推荐(0)
vue3-provide/inject 注入
摘要: 为深度嵌套的组件,父组件provide提供数据来源,子组件inject开始使用这个数据 provide: { todoLength: this.todos.length // 将会导致错误 'Cannot read property 'length' of undefined` }, //要访问组件
阅读全文
posted @ 2021-02-25 16:18 6NULL9
阅读(918)
评论(0)
推荐(0)
javaScript设计模式
摘要: 1.实现单例模式: 保证一个类仅有一个实例,并提供一个访问它的全局访问点 var Singleton = function( name ){ this.name = name; this.instance = null; }; Singleton.prototype.getName = functi
阅读全文
posted @ 2021-02-25 16:12 6NULL9
阅读(86)
评论(0)
推荐(0)
javaScript语言精粹--函数
摘要: 函数就是对象,对象字面量产生的对象连接到Object.prototype,函数对象连接到Function.prototype,每个函数还接收两个附加的参数:this(依不同调用模式指向不同)和arguments函数调用共4种调用模式:方法调用模式,函数调用模式,构造器调用模式和apply调用模式 方
阅读全文
posted @ 2021-02-25 16:09 6NULL9
阅读(67)
评论(0)
推荐(0)
2021年2月24日
matchMedia 媒体查询结果
摘要: window.matchMedia(mediaQueryString) mediaQueryString: 必需,一个字符串,表示即将返回一个新 MediaQueryList 对象的媒体查询 min-height, min-width, orientation等。 function myFuncti
阅读全文
posted @ 2021-02-24 21:23 6NULL9
阅读(78)
评论(0)
推荐(0)
异常捕获
摘要: /** * @param {String} message 错误信息 * @param {String} source 出错文件 * @param {Number} lineno 行号 * @param {Number} colno 列号 * @param {Object} error Error对
阅读全文
posted @ 2021-02-24 16:38 6NULL9
阅读(65)
评论(0)
推荐(0)
2021年2月22日
常用xpath选择器和css选择器总结
摘要: xpath选择器 表达式说明 article 选取所有article元素的所有子节点 /article 选取根元素article article/a 选取所有属于article的子元素的a元素 //div 选取所有div子元素(不论出现在文档任何地方) article//div 选取所有属于arti
阅读全文
posted @ 2021-02-22 21:41 6NULL9
阅读(173)
评论(0)
推荐(0)
python-爬虫中的extract()
摘要: <ul class="list"> <li>123</li> <li>abc</li> </ul> #1 xx.xpath("./ul[@class='list']/li") #xx是html文档 #xpath解析返回一个解析器列表 #2 xx.xpath("./ul[@class='list']/
阅读全文
posted @ 2021-02-22 21:28 6NULL9
阅读(486)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
···
18
下一页
公告