百度:Tangram
基本上就是个百度版jQuery,2.0版本使用链式API,更像了。
配套的还有UI库Magic和模版引擎BaiduTemplate(和ejs很像)
腾讯:JX
理念在介绍里面写的很详细,代码清晰,注释丰富,可读性很好,但只有文档没有实例。
比较传统的大块头框架,本质上来说还是一堆工具方法和对象的堆积,提供了很基本的模块化的开发方式,但没有模块间的依赖关系支持。
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title></title> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| <script> | |
| // coolshell api | |
| function xss_ajax(url, callback) { | |
| var script_id = null; | |
| var script = document.createElement('script'); |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title></title> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
| <style> | |
| body { | |
| font-family: 'Helvetica Neue', Arial, 'Microsoft Yahei', sans-serif; | |
| padding: 0 30px; | |
| color: #333; |
| // Turns a function's body into a worker | |
| var workerify = function (func) { | |
| if (typeof func !== 'function') { | |
| throw new Error('expects a function to workerify.') | |
| } | |
| var script = func.toString().match(/^function[^{]*{((.|\n)*)}$/)[1], | |
| blob = new Blob([script], {'type': 'application/javascript'}), | |
| url = window.URL.createObjectURL(blob) | |
| return new Worker(url) | |
| } |
| grunt.registerTask( 'dev', 'start deving y\'all', function () { | |
| grunt.task.run('watch') | |
| grunt.util.spawn({ | |
| cmd: 'dev_appserver.py', | |
| args: ['./app.yaml'], | |
| opts: { | |
| stdio: 'inherit' | |
| } |
| alias ng="npm list -g --depth=0 2>/dev/null" | |
| alias nl="npm list --depth=0 2>/dev/null" |
| Function.prototype.bind = function (context) { | |
| if (typeof this !== 'function') { | |
| throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); | |
| } | |
| var fn = this, // the function to bind | |
| slice = Array.prototype.slice // cache slice method | |
| args = slice.call(arguments, 1), // get the array of addtional arguments (to be curried) | |
| noop = function () {}, // the intermediate function to serve as a prototype chain connector | |
| // (assuming we don't have Object.create() here) | |
| bound = function () { |
斐波那契者 得甲
閱甲
零乎
零是也
壹乎
壹是也
它者乎
前者 甲 壹 差之 遞歸之也
前前者 甲 貳 差之 遞歸之也
| var now = new Date(), | |
| year = now.getYear() + 1900, | |
| first = new Date(year, 0, 0), | |
| elapsedMs = now.getTime() - first.getTime(), | |
| elapsedDays = ~~(elapsedMs / (1000 * 60 * 60 * 24)) | |
| if (elapsedDays === Math.pow(2, 8)) { | |
| console.log("Yes. Happy Programmers' Day!") | |
| } else { | |
| console.log("No. Get back to work.") |