2013年9月27日

js 面试题

摘要: 引用http://blog.csdn.net/xuejianwu/article/details/7871932一、JS闭包。f = function() {return true;};g = function() {return false;};(function() { if (g() && [] == ![]) { f = function f() {return false;}; function g() {return true;} }})();alert(f()); // true or false ?------------------------答案:(func 阅读全文

posted @ 2013-09-27 10:22 wssdzf 阅读(398) 评论(0) 推荐(0) 编辑

2013年9月25日

angular 写的一个分页功能

摘要: 是jsgen 的分页功能,贴出来,也说说我的感受, 阅读全文

posted @ 2013-09-25 16:14 wssdzf 阅读(219) 评论(0) 推荐(0) 编辑

2013年9月24日

angular scope 方法

摘要: $watch:给变量添加监控事件,变量值发生改变是触发。 阅读全文

posted @ 2013-09-24 13:18 wssdzf 阅读(145) 评论(0) 推荐(0) 编辑

avalon 框架

摘要: https://github.com/RubyLouvre/avalon准备学习。 阅读全文

posted @ 2013-09-24 11:15 wssdzf 阅读(137) 评论(0) 推荐(0) 编辑

2013年9月23日

贴几个常用的基础函数

摘要: 取自jsGen的tool.js function isArray(obj) { return Array.isArray ? Array.isArray(obj) : Object.prototype.toString.call(obj) === '[object Array]'; } function isNull(obj) { return obj === null || obj === undefined || obj !== obj; } function toStr(value) { return isNull(v... 阅读全文

posted @ 2013-09-23 15:43 wssdzf 阅读(293) 评论(0) 推荐(1) 编辑

angular 和 backbone 区别

摘要: 参考:http://angularjs.cn/A0cV;Backbone的Model把服务器端的数据模型映射到浏览器端,绑定数据验证机制,并与相应的REST操作绑定,这样每个数据模型都变成了独立体,方便REST操作,却限制REST的灵活性。比如我要将10个todo批量标记成已完成,它会发出10个REST请求。Backbone的Model没有与UI视图数据绑定,而是需要在View中自行操作DOM来更新或读取UI数据,这点很奇怪。AngularJS与此相反,Model直接与UI视图绑定,Model与UI视图的关系,通过directive封装,AngularJS内置的通用directive,就能实现 阅读全文

posted @ 2013-09-23 10:16 wssdzf 阅读(493) 评论(0) 推荐(1) 编辑

2013年9月18日

ejs layout

摘要: express 3.x 中使用ejs的模版比较麻烦一点,但是还是很容易的。已经不支持layout功能了,用include实现,更强大了。Currently EJS has no notion of blocks, only compile-timeincludes, however you may still utilize this feature to implement "layouts" by simply including a header and footer like so:TitleMy page 阅读全文

posted @ 2013-09-18 14:11 wssdzf 阅读(281) 评论(0) 推荐(0) 编辑

2013年9月17日

Function.prototype.call.apply结合用法分析示例

摘要: 参考:http://www.jb51.net/article/39456.htm昨天在网上看到一个很有意思的js面试题,就跟同事讨论了下,发现刚开始很绕最后豁然开朗,明白过来之后发现还是挺简单的,跟大家分享下!题目如下:var a = Function.prototype.call.apply(function(a){return a;}, [0,4,3]);alert(a);分析步骤如下:1、将Function.prototype.call当成整体,call方法是由浏览器实现的本地方法,是函数类型的内部方法var a = (Function.prototype.call).apply(fun 阅读全文

posted @ 2013-09-17 17:14 wssdzf 阅读(134) 评论(0) 推荐(0) 编辑

angular ui-router

摘要: ui-router 用法页面上用ui-sref directives 他的值就是state的名字,从config找到这个值为a标签添加href 属性,.连接实现嵌套功能,比如ui-sref 的值是router2.list 是router 页面下在嵌套一个list 页面。 阅读全文

posted @ 2013-09-17 16:20 wssdzf 阅读(621) 评论(0) 推荐(0) 编辑

2013年9月13日

Angular Setting Class In Ng-Repeat

摘要: 参考:http://stackoverflow.com/questions/18468321/angular-setting-class-in-ng-repeatng-repeat 是添加样式,ng-class 支持json格式添加样式,把参数传进去,对样式进行判断,确定是否添加。支持函数格式添加样式,可以运行一个函数,添加返回值。 阅读全文

posted @ 2013-09-13 15:24 wssdzf 阅读(408) 评论(0) 推荐(0) 编辑

导航