GitHub 博客园 Nanakon

随笔分类 -  021.JavaScript

ES2015 (ES6)
摘要:是时候使用ES 2015了你可能不再需要UnderscoreBABELGrunt 先babel 再用babel 后的文件uglify去掉严格模式。严格模式下全局的this转成了undefined 阅读全文

posted @ 2015-10-13 14:00 jzm17173 阅读(171) 评论(0) 推荐(0)

存取器
摘要:/* * 一旦定义了取值函数get(或存值函数set),就不能将writable设为true,或者同时定义value属性,否则会报错 * 存取器往往用于,某个属性的值需要依赖对象内部数据的场合 */function Loading() { Object.defineProperty(this,... 阅读全文

posted @ 2015-09-28 17:23 jzm17173 阅读(144) 评论(0) 推荐(0)

js
摘要:参数处理 获取伪元素属性 递归 阅读全文

posted @ 2015-09-28 15:53 jzm17173 阅读(145) 评论(0) 推荐(0)

createElement
摘要: 阅读全文

posted @ 2015-09-18 15:54 jzm17173 阅读(121) 评论(0) 推荐(0)

\u202e
摘要:document.write('\u202e1\u202e2\u202e3') // 321 阅读全文

posted @ 2015-09-07 17:40 jzm17173 阅读(289) 评论(0) 推荐(0)

decodeURIComponent
摘要:var s = '%%'try { s = decodeURIComponent(s)} catch(e) { console.log(e)}console.log(s) 阅读全文

posted @ 2015-08-10 09:42 jzm17173 阅读(116) 评论(0) 推荐(0)

百度视频搜索提示
摘要:百度视频 - Suggestion 组件生成URLhttp://so.baomihua.com/DataList.aspx?keyword=2&ct=301989888&rn=20&pn=0&db=0&cacaca=cacaca&s=0&fbl=800&ie=utf-8 阅读全文

posted @ 2015-07-31 16:40 jzm17173 阅读(165) 评论(0) 推荐(0)

if('str' === str)
摘要:小谈 JavaScript 的 if 语句写法 阅读全文

posted @ 2015-07-17 16:38 jzm17173 阅读(158) 评论(0) 推荐(0)

once
摘要:var once = function(obj, evtType, handler) { var f = function() { //console.log(arguments) handler.apply(window, arguments) ob... 阅读全文

posted @ 2015-06-04 17:17 jzm17173 阅读(134) 评论(0) 推荐(0)

JavaScript 中的 相等检测
摘要:JavaScript 中的 相等检测 阅读全文

posted @ 2015-05-13 16:05 jzm17173 阅读(101) 评论(0) 推荐(0)

Date
摘要:var d1 = new Date(2015, 4, 31)var d2 = new Date(2015, 4, 32)var d3 = new Date(2015, 4, -1)console.log(d1)console.log(d2)console.log(d3)console.log(d1.... 阅读全文

posted @ 2015-05-08 14:03 jzm17173 阅读(110) 评论(0) 推荐(0)

类型转换
摘要:console.log(typeof('22' - 0)) // number 阅读全文

posted @ 2015-05-08 10:24 jzm17173 阅读(93) 评论(0) 推荐(0)

>>>
摘要:this.length >>> 0表示什么?var a = 222var b = a>>>0console.log(a, b, typeof(a), typeof(b))var a = -222var b = a>>>0console.log(a, b, typeof(a), typeof(b))v... 阅读全文

posted @ 2015-04-23 15:37 jzm17173 阅读(107) 评论(0) 推荐(0)

id有空格获取不到元素
摘要: 阅读全文

posted @ 2015-04-21 14:31 jzm17173 阅读(114) 评论(0) 推荐(0)

【DOM】
摘要:也许,DOM 不是答案 阅读全文

posted @ 2015-04-02 10:30 jzm17173 阅读(83) 评论(0) 推荐(0)

年月日
摘要:闰年判断function isLeapYear(y) { return ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)}公元年数可被4整除为闰年,但是整百(个位和十位均为0)的年数必须是可以被400整除的才是闰年。其他都是平年。闰年的2月有29天。例如... 阅读全文

posted @ 2015-03-31 11:12 jzm17173 阅读(124) 评论(0) 推荐(0)

【JavaScript】
摘要:右键禁用、防止文字选中 、返回选中的文本JavaScript 原理Javascript高性能动画与页面渲染前端不为人知的一面--前端冷知识集锦屏幕外去计算值,position:absolute;left:-20000px; 阅读全文

posted @ 2015-03-27 16:49 jzm17173 阅读(114) 评论(0) 推荐(0)

-_-#在CSS文件中内嵌JavaScript
摘要:黑魔法:在CSS文件中内嵌JavaScript 阅读全文

posted @ 2014-12-29 14:25 jzm17173 阅读(130) 评论(0) 推荐(0)

-_-#toFixed
摘要:parseFloattoFixed 阅读全文

posted @ 2014-12-25 14:08 jzm17173 阅读(90) 评论(0) 推荐(0)

-_-#获取光标位置
摘要:获取 Textarea 的光标位置 阅读全文

posted @ 2014-12-23 15:41 jzm17173 阅读(114) 评论(0) 推荐(0)

导航

轻音