
javascript
alonia
这个作者很懒,什么都没留下…
展开
-
DOM事件 中的 focus 和blur
今天做一个表单验证时 ,遇到一个问题,利用form.addEventListener 绑定事件时,发现focus 不起作用 通过查阅资料 终于知道了问题出在哪里? (资料出处https://developer.mozilla.org/en-US/docs/Web/Events/ 和 https://segmentfault.com/a/1190000003942014) 1.不是所有事原创 2016-05-10 16:46:41 · 2453 阅读 · 0 评论 -
遇到上传文件时后台返回带<pre>标签的问题
解决方法 :后台配置 text/html 前台 ajax 返回值加一句 xhr.responseText.match(/<pre.+?>(.+)<\/pre>/ig)!=null?jQuery(xhr.responseText).text():xhr.responseText原创 2018-07-24 17:31:15 · 1698 阅读 · 0 评论 -
git 保存用户名和密码
$ git config credential.helper store $ git push http://github.com.test.git Username: <type your username> Password: <type your password> gitlab github ssh 配置 https://blog.youkuaiyun.com...原创 2018-08-30 16:34:55 · 1236 阅读 · 0 评论 -
js 解决全局变量污染问题
1 通过函数 function b(){ var a= 2 function c(){ } } 2.通过对象 var obj = {}; var a = function(){ this.b = 2; this.add = function(){ } } new a() 3 立即执行函数 var objs = {}; $(fu...原创 2018-08-20 17:52:14 · 1337 阅读 · 0 评论 -
js call apply bind
call 、bind 、 apply 这三个函数的第一个参数都是 this 的指向对象,第二个参数差别就来了: call 的参数是直接放进去的,第二第三第 n 个参数全都用逗号分隔,直接放到后面 obj.myFun.call(db,'成都', ... ,'string' )。 apply 的所有参数都必须放在一个数组里面传进去 obj.myFun.apply(db,['成都', ..., 's...原创 2018-12-14 14:45:43 · 235 阅读 · 0 评论