摘要: `$.extend()`:将两个或更多对象合并到第一个对象;这里所说的实现只是实现两个对象的合并(浅实现):```jsfunction extend(default_item,new_item){ if(new_item){ for(var i in default_item){... 阅读全文
posted @ 2015-08-11 21:10 夏棋 阅读(338) 评论(0) 推荐(0) 编辑
摘要: 应该来说这是两两配对的时间mouseenter和mouseleave是只对选中的元素的生效mouseover和mouseout是只对选中的元素及其子元素生效 阅读全文
posted @ 2015-07-25 09:28 夏棋 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 应该来说这是两两配对的时间`mouseenter`和`mouseleave`是只对选中的元素的生效`mouseover`和`mouseout`是只对选中的元素及其子元素生效 阅读全文
posted @ 2015-07-25 09:19 夏棋 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 先上代码 这边的chunk是两个buffer,暂时还不知道怎么合并( 留 ) 看到一个解决方案,大致可以解决 javascript var superagent = require('superagent'); var cheerio = require('cheerio'); var http = 阅读全文
posted @ 2015-07-24 19:08 夏棋 阅读(160) 评论(1) 推荐(0) 编辑
摘要: 都会返回类型信息,但installedof与内存中的比较typeof与字符串比较//objects var Person = function() {} var gary = new Person(); console.log(typeof(gary)); // "object" gary ... 阅读全文
posted @ 2015-06-02 08:09 夏棋 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 阻止事件发生之前就执行了函数除了创建匿名函数function foo(a){ console.log(a);}document.onclick=foo(1)//document.onclick=function(){foo(1)}// document.addEventListener('clic... 阅读全文
posted @ 2015-06-01 09:15 夏棋 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 一直以为是很简单的问题,但是昨天碰到一个问题,今天特地来试试html: JS Bin css:div{ width: 100px; height: 100px; background: #000; float: left;}.inner{ height: 100px; wid... 阅读全文
posted @ 2015-05-31 08:25 夏棋 阅读(131) 评论(0) 推荐(0) 编辑
摘要: ==不知道写什么了。其实是看过两次的,都是在mdn上看的,一个是iframe实现的另一个就是div contentEditable="true"这样,然后就是document.execCommand()设置样式了,其实我也不知道他是怎么识别编辑内容的,难道是自动的?代码一搜一大把这里就不上了,我看了... 阅读全文
posted @ 2015-05-29 14:14 夏棋 阅读(143) 评论(0) 推荐(0) 编辑
摘要: ,函数也是对象,所有声明的函数都具有length,call,apply,constructor,以及prototype五个property,length返回的是参数的个数。prototype则是对象。另外三个都是方法。constructor则返回构造函数。说说prototype。prototype是... 阅读全文
posted @ 2015-05-20 12:55 夏棋 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 在数据传送过程中json是以字符串的形式传输的,但是js操作的是json对象,所以需要对json进行解析,早期解析json使用的是eval()函数,可以解析解释并返回js对象和数组,es5加入了JSON全局对象,IE8+,firefox3.5+,safari4+,chrome和opera10.5+。... 阅读全文
posted @ 2015-05-17 11:10 夏棋 阅读(181) 评论(0) 推荐(0) 编辑